fix(snapshot): fallback secrets vsphere_user/pass (nom Settings UI) en plus de vcenter_user/pass legacy
This commit is contained in:
parent
2209192e2b
commit
a1476cb3e2
@ -111,10 +111,13 @@ def snapshot_server(hostname, vm_name, branch, db, snap_name=None):
|
||||
if not PYVMOMI_OK:
|
||||
return {"ok": False, "vcenter": "", "detail": "pyvmomi non installe", "skipped": True}
|
||||
|
||||
vc_user = _get_secret(db, "vcenter_user")
|
||||
vc_pass = _get_secret(db, "vcenter_pass")
|
||||
# Fallback historique : vcenter_user/vcenter_pass (legacy) ou vsphere_user/vsphere_pass (Settings UI)
|
||||
vc_user = _get_secret(db, "vcenter_user") or _get_secret(db, "vsphere_user")
|
||||
vc_pass = _get_secret(db, "vcenter_pass") or _get_secret(db, "vsphere_pass")
|
||||
if not vc_user or not vc_pass:
|
||||
return {"ok": False, "vcenter": "", "detail": "Credentials vCenter manquants (vcenter_user/vcenter_pass dans Settings > Secrets)", "skipped": True}
|
||||
return {"ok": False, "vcenter": "",
|
||||
"detail": "Credentials vCenter manquants (renseigner vsphere_user/vsphere_pass dans Settings > vSphere)",
|
||||
"skipped": True}
|
||||
|
||||
search_name = vm_name or hostname
|
||||
if not snap_name:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user