diff --git a/app/services/quickwin_snapshot_service.py b/app/services/quickwin_snapshot_service.py index ea98385..210c51e 100644 --- a/app/services/quickwin_snapshot_service.py +++ b/app/services/quickwin_snapshot_service.py @@ -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: