From a1476cb3e2faa9d050721e49df7b428c33add3d4 Mon Sep 17 00:00:00 2001 From: Admin MPCZ Date: Mon, 4 May 2026 16:07:50 +0200 Subject: [PATCH] fix(snapshot): fallback secrets vsphere_user/pass (nom Settings UI) en plus de vcenter_user/pass legacy --- app/services/quickwin_snapshot_service.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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: