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:
parent
a1476cb3e2
commit
a68d9494f1
@ -701,7 +701,10 @@ async def iexec_snapshot(request: Request, row_id: int, db=Depends(get_db)):
|
|||||||
today = datetime.now().strftime("%Y-%m-%d")
|
today = datetime.now().strftime("%Y-%m-%d")
|
||||||
snap_name = f"{intervenant}_{today}_avant_patch"
|
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
|
from ..services.quickwin_snapshot_service import snapshot_server
|
||||||
result = snapshot_server(hostname, vm_name, branch, db, snap_name=snap_name)
|
result = snapshot_server(hostname, vm_name, branch, db, snap_name=snap_name)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user