fix(patching/iexec snapshot): toujours chercher la VM dans vCenter par hostname (s.vcenter_vm_name peut etre faux en base)

This commit is contained in:
Pierre & Lumière 2026-05-04 16:12:50 +02:00
parent a1476cb3e2
commit a68d9494f1

View File

@ -701,7 +701,10 @@ async def iexec_snapshot(request: Request, row_id: int, db=Depends(get_db)):
today = datetime.now().strftime("%Y-%m-%d")
snap_name = f"{intervenant}_{today}_avant_patch"
vm_name = row.vcenter_vm_name or hostname
# On cherche la VM dans vCenter par son hostname (pas par s.vcenter_vm_name
# qui peut être faux en base). Si plus tard on a un cas où la VM porte un
# nom différent, on rajoutera un mapping explicite.
vm_name = hostname
from ..services.quickwin_snapshot_service import snapshot_server
result = snapshot_server(hostname, vm_name, branch, db, snap_name=snap_name)