chore(snapshot): strip() defensif sur credentials vCenter (copier-coller peut ajouter newline/CR)
This commit is contained in:
parent
a006e3f422
commit
37e6f0d8f3
@ -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)",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user