From ccedba341184fcd04960b7167fbc7849ea691eb7 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 23 Aug 2026 18:05:55 -0400 Subject: [PATCH] =?UTF-8?q?[ADD]=20proxmox=20:=20r=C3=A9capituler=20dans?= =?UTF-8?q?=20le=20terminal=20avant=20de=20cr=C3=A9er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L'écran montre le plan, mais la création part sur une machine qui n'est pas la nôtre, et l'hôte va demander sudo juste après. La ligne dit donc où, quoi et combien — hôte, stockage, pont, puis une ligne par VM avec son VMID et son adresse — et attend un oui. Le déploiement QEMU/KVM le fait déjà ; c'était la seule étape qui manquait ici. --- EN --- The screen shows the plan, but creation goes to a machine that is not ours, and the host will ask for sudo right after. So the recap says where, what and how many — host, storage, bridge, then one line per VM with its VMID and address — and waits for a yes. The QEMU/KVM deployment already does this; it was the only step missing here. Assisted-by: Claude Opus 5 --- script/todo/proxmox_menu.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/script/todo/proxmox_menu.py b/script/todo/proxmox_menu.py index 729ef46..249660b 100644 --- a/script/todo/proxmox_menu.py +++ b/script/todo/proxmox_menu.py @@ -707,6 +707,9 @@ class ProxmoxMenuMixin: from script.proxmox import proxmox_deploy as pve from script.todo.deploy_form_lib import run_deploy_progress + if not dry_run and not self._pve_confirm_spec(host, spec): + print(t("Cancelled.")) + return cle_locale = spec.get("ssh_key") or self._qemu_default_ssh_key() if cle_locale and not dry_run: if self._pve_push_key(cle_locale): @@ -739,6 +742,8 @@ class ProxmoxMenuMixin: return if spec["existing"]: print(f" ⏭ {t('already there')} : {', '.join(spec['existing'])}") + if not travaux: + return resultats = run_deploy_progress(travaux, spec.get("parallelism") or 1) reussies = [nom for nom, code, _o, _d in resultats if code == 0] for nom, code, sortie, _duree in resultats: @@ -749,6 +754,32 @@ class ProxmoxMenuMixin: return self._pve_after_create(host, spec, reussies, cle_locale) + def _pve_confirm_spec(self, host, spec): + """Récapitulatif puis confirmation, dans le TERMINAL. + + L'écran a montré le plan, mais c'est ici que ça devient réel — et sur + une machine qui n'est pas la nôtre. La ligne dit donc où, quoi, et + combien, avant le mot de passe sudo que l'hôte va demander.""" + print(f"\n {t('Proxmox host')} : {self._pve_label(host)}") + print( + f" {t('storage')} {spec['storage']} " + f"{t('bridge')} {spec['bridge']} [{spec['res_label']}]" + ) + for vm in spec["vms"]: + print( + f" {vm['name']:32} {t('VMID')} {vm['vmid']} " + f"{vm['vcpus']} vCPU {vm['ram']} Mo {vm['disk']} " + f"{(vm.get('ipconfig') or '').replace('ip=', '')}" + ) + if spec.get("install"): + print( + f" ERPLibre : {spec['install'].get('label') or ''}" + f" ({spec['install'].get('branch')})" + ) + return self._is_yes_default_yes( + input(f"\n{t('Deploy this VM now? (Y/n): ')}") + ) + def _pve_after_create(self, host, spec, reussies, cle_locale): """Ce qui suit la création : l'adresse, ~/.ssh/config, l'installation.