diff --git a/app/services/quickwin_snapshot_service.py b/app/services/quickwin_snapshot_service.py index 1adecc3..ede2b7c 100644 --- a/app/services/quickwin_snapshot_service.py +++ b/app/services/quickwin_snapshot_service.py @@ -149,8 +149,9 @@ def snapshot_server(hostname, vm_name, branch, db, snap_name=None): return {"ok": False, "vcenter": "", "detail": "pyvmomi non installe", "skipped": True} # 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") + # .strip() défensif : un copier-coller peut introduire \n / \r / espaces + vc_user = (_get_secret(db, "vcenter_user") or _get_secret(db, "vsphere_user") or "").strip() + vc_pass = (_get_secret(db, "vcenter_pass") or _get_secret(db, "vsphere_pass") or "").strip() if not vc_user or not vc_pass: return {"ok": False, "vcenter": "", "detail": "Credentials vCenter manquants (renseigner vsphere_user/vsphere_pass dans Settings > vSphere)",