fix(oci): confirm the release of a private network by its result

This commit is contained in:
MacRimi
2026-11-01 11:39:56 +01:00
parent ac2bd28d25
commit 5ea0645e31
6 changed files with 21 additions and 20 deletions
@@ -20,7 +20,7 @@ INSTALL = ROOT / 'oci/remote/install_oci.sh'
PREVIEW = 'Private network targeted for release if no other guest uses it:' PREVIEW = 'Private network targeted for release if no other guest uses it:'
CONFIRM = 'Remove the application? Its container disks are deleted, and only a backup can bring them back.' CONFIRM = 'Remove the application? Its container disks are deleted, and only a backup can bring them back.'
RESULT = 'Removal command finished; review any warnings above.' RESULT = 'Removal command finished; review any warnings above.'
BRIDGE = 'Private network release attempted:' BRIDGE = 'Private network of the application released:'
BRIDGE_FAILURE = 'Could not complete private network release:' BRIDGE_FAILURE = 'Could not complete private network release:'
SUCCESS = 'The application was removed' SUCCESS = 'The application was removed'
FIREWALL = 'Could not verify removal of the managed host firewall rule.' FIREWALL = 'Could not verify removal of the managed host firewall rule.'
@@ -261,7 +261,7 @@ class RemovalWordings(unittest.TestCase):
self.assertIn(('warn', FIREWALL), events) self.assertIn(('warn', FIREWALL), events)
self.assertEqual(events[-1], ('ok', RESULT)) self.assertEqual(events[-1], ('ok', RESULT))
def test_ignored_bridge_command_failures_do_not_claim_release(self): def test_a_failed_bridge_release_warns_instead_of_claiming_it(self):
events = [] events = []
scope = {'members_of': lambda root, vmid: (101, {}, [101]), scope = {'members_of': lambda root, vmid: (101, {}, [101]),
'instances': SimpleNamespace(read=lambda root, vmid: {'installation_id': 'owned'}, 'instances': SimpleNamespace(read=lambda root, vmid: {'installation_id': 'owned'},
@@ -278,11 +278,12 @@ class RemovalWordings(unittest.TestCase):
'oci_console': SimpleNamespace(remove_log=lambda vmid: None), 'oci_console': SimpleNamespace(remove_log=lambda vmid: None),
'guest_node': lambda vmid: None, 'remove_host_state': lambda vmid: None, 'release_shared_host_files': lambda hookscripts: None, 're': re, 'guest_node': lambda vmid: None, 'remove_host_state': lambda vmid: None, 'release_shared_host_files': lambda hookscripts: None, 're': re,
'translate': lambda text: text, 'msg_info': lambda text: None, 'translate': lambda text: text, 'msg_info': lambda text: None,
'msg_ok': lambda text: events.append(('ok', text)), 'msg_warn': lambda text: None} 'msg_ok': lambda text: events.append(('ok', text)),
'msg_warn': lambda text: events.append(('warn', text))}
extract(REMOVE, 'remove', scope)(Path('/inert'), 101) extract(REMOVE, 'remove', scope)(Path('/inert'), 101)
self.assertIn(('attempt', 'vmbr9'), events) self.assertIn(('attempt', 'vmbr9'), events)
self.assertIn(('ok', BRIDGE + ' vmbr9'), events) self.assertIn(('warn', BRIDGE_FAILURE + ' vmbr9'), events)
self.assertNotIn(('ok', 'Private network of the application released: vmbr9'), events) self.assertNotIn(('ok', BRIDGE + ' vmbr9'), events)
def test_invalid_managed_firewall_metadata_warns_instead_of_silent_clean(self): def test_invalid_managed_firewall_metadata_warns_instead_of_silent_clean(self):
events = [] events = []
+1 -1
View File
@@ -1482,7 +1482,7 @@
"Could not check the NVIDIA GPU": "Konnte die NVIDIA GPU nicht überprüfen", "Could not check the NVIDIA GPU": "Konnte die NVIDIA GPU nicht überprüfen",
"Could not clone any gasket-driver repository. Check your internet connection and": "Es konnte kein gasket-driver-Repository geklont werden. Überprüfen Sie Ihre Internetverbindung und", "Could not clone any gasket-driver repository. Check your internet connection and": "Es konnte kein gasket-driver-Repository geklont werden. Überprüfen Sie Ihre Internetverbindung und",
"Could not complete or verify the repository switch; changes may be partial and repository state is unknown. Inspect {ui} before retrying; no automatic rollback was attempted.": "Der Repository-Wechsel konnte nicht abgeschlossen oder überprüft werden; die Änderungen sind möglicherweise unvollständig und der Zustand der Repositorys ist unbekannt. Prüfen Sie {ui}, bevor Sie es erneut versuchen; es wurde kein automatisches Zurücksetzen versucht.", "Could not complete or verify the repository switch; changes may be partial and repository state is unknown. Inspect {ui} before retrying; no automatic rollback was attempted.": "Der Repository-Wechsel konnte nicht abgeschlossen oder überprüft werden; die Änderungen sind möglicherweise unvollständig und der Zustand der Repositorys ist unbekannt. Prüfen Sie {ui}, bevor Sie es erneut versuchen; es wurde kein automatisches Zurücksetzen versucht.",
"Could not complete private network release:": "Die Veröffentlichung des privaten Netzwerks konnte nicht abgeschlossen werden:", "Could not complete private network release:": "Das private Netzwerk konnte nicht vollständig freigegeben werden:",
"Could not configure IOMMU kernel parameters automatically. Configure manually and reboot.": "IOMMU-Kernelparameter konnten nicht automatisch konfiguriert werden. Manuell konfigurieren und neu starten.", "Could not configure IOMMU kernel parameters automatically. Configure manually and reboot.": "IOMMU-Kernelparameter konnten nicht automatisch konfiguriert werden. Manuell konfigurieren und neu starten.",
"Could not configure the tmpfs mounts": "Die tmpfs-Mounts konnten nicht konfiguriert werden", "Could not configure the tmpfs mounts": "Die tmpfs-Mounts konnten nicht konfiguriert werden",
"Could not convert the OCI rootfs to privileged": "Konnte die OCI-Rootfs nicht in privilegierte umwandeln", "Could not convert the OCI rootfs to privileged": "Konnte die OCI-Rootfs nicht in privilegierte umwandeln",
+4 -4
View File
@@ -1482,7 +1482,7 @@
"Could not check the NVIDIA GPU": "Impossible de vérifier le GPU NVIDIA", "Could not check the NVIDIA GPU": "Impossible de vérifier le GPU NVIDIA",
"Could not clone any gasket-driver repository. Check your internet connection and": "Impossible de cloner un dépôt gasket-driver. Vérifiez votre connexion Internet et", "Could not clone any gasket-driver repository. Check your internet connection and": "Impossible de cloner un dépôt gasket-driver. Vérifiez votre connexion Internet et",
"Could not complete or verify the repository switch; changes may be partial and repository state is unknown. Inspect {ui} before retrying; no automatic rollback was attempted.": "Impossible de terminer ou de vérifier le changement de référentiel ; les modifications peuvent être partielles et l'état des référentiels est inconnu. Inspectez {ui} avant de réessayer ; aucun retour arrière automatique n'a été tenté.", "Could not complete or verify the repository switch; changes may be partial and repository state is unknown. Inspect {ui} before retrying; no automatic rollback was attempted.": "Impossible de terminer ou de vérifier le changement de référentiel ; les modifications peuvent être partielles et l'état des référentiels est inconnu. Inspectez {ui} avant de réessayer ; aucun retour arrière automatique n'a été tenté.",
"Could not complete private network release:": "Impossible de terminer la version du réseau privé :", "Could not complete private network release:": "Impossible de terminer la libération du réseau privé :",
"Could not configure IOMMU kernel parameters automatically. Configure manually and reboot.": "Impossible de configurer automatiquement les paramètres du noyau IOMMU. Configurez manuellement et redémarrez.", "Could not configure IOMMU kernel parameters automatically. Configure manually and reboot.": "Impossible de configurer automatiquement les paramètres du noyau IOMMU. Configurez manuellement et redémarrez.",
"Could not configure the tmpfs mounts": "Impossible de configurer les montages tmpfs", "Could not configure the tmpfs mounts": "Impossible de configurer les montages tmpfs",
"Could not convert the OCI rootfs to privileged": "Impossible de convertir les roofs de l'OCI en privilégiés", "Could not convert the OCI rootfs to privileged": "Impossible de convertir les roofs de l'OCI en privilégiés",
@@ -5275,10 +5275,10 @@
"Private network assigned automatically:": "Réseau privé assigné automatiquement:", "Private network assigned automatically:": "Réseau privé assigné automatiquement:",
"Private network kept, because other containers still use it:": "Réseau privé conservé, car d'autres conteneurs l'utilisent encore :", "Private network kept, because other containers still use it:": "Réseau privé conservé, car d'autres conteneurs l'utilisent encore :",
"Private network kept, because other guests still use it:": "Réseau privé conservé, car d'autres VM ou CT l'utilisent encore :", "Private network kept, because other guests still use it:": "Réseau privé conservé, car d'autres VM ou CT l'utilisent encore :",
"Private network of the application released:": "Réseau privé de la demande publiée:", "Private network of the application released:": "Réseau privé de l'application libéré :",
"Private network of the application that is released:": "Réseau privé de la demande qui est publiée:", "Private network of the application that is released:": "Réseau privé de l'application qui est libéré :",
"Private network release attempted:": "Tentative de publication sur un réseau privé :", "Private network release attempted:": "Tentative de publication sur un réseau privé :",
"Private network targeted for release if no other guest uses it:": "Réseau privé dont la publication est ciblée si aucun autre invité ne l'utilise :", "Private network targeted for release if no other guest uses it:": "Réseau privé à libérer si aucun autre invité ne l'utilise :",
"Private network:": "Réseau privé:", "Private network:": "Réseau privé:",
"Private personal knowledge management": "Gestion privée des connaissances personnelles", "Private personal knowledge management": "Gestion privée des connaissances personnelles",
"Privileged": "Privilégié", "Privileged": "Privilégié",
+3 -3
View File
@@ -5275,10 +5275,10 @@
"Private network assigned automatically:": "Rede privada atribuída automaticamente:", "Private network assigned automatically:": "Rede privada atribuída automaticamente:",
"Private network kept, because other containers still use it:": "Mensagem técnica para Proxmox e TI.Traduzindo: Rede privada mantida, pois outros containers ainda a utilizam:", "Private network kept, because other containers still use it:": "Mensagem técnica para Proxmox e TI.Traduzindo: Rede privada mantida, pois outros containers ainda a utilizam:",
"Private network kept, because other guests still use it:": "Rede privada mantida, porque outras VM ou CT ainda a utilizam:", "Private network kept, because other guests still use it:": "Rede privada mantida, porque outras VM ou CT ainda a utilizam:",
"Private network of the application released:": "Rede privada do aplicativo lançado:", "Private network of the application released:": "Rede privada do aplicativo liberada:",
"Private network of the application that is released:": "Rede privada do aplicativo que é lançado:", "Private network of the application that is released:": "Rede privada do aplicativo que é liberada:",
"Private network release attempted:": "Tentativa de liberação de rede privada:", "Private network release attempted:": "Tentativa de liberação de rede privada:",
"Private network targeted for release if no other guest uses it:": "rede privada destinada a ser liberada se nenhum outro convidado a utilizar:", "Private network targeted for release if no other guest uses it:": "Rede privada a ser liberada se nenhum outro convidado a utilizar:",
"Private network:": "Rede privada:", "Private network:": "Rede privada:",
"Private personal knowledge management": "Gestão privada do conhecimento pessoal", "Private personal knowledge management": "Gestão privada do conhecimento pessoal",
"Privileged": "Privilegiado", "Privileged": "Privilegiado",
+4 -4
View File
@@ -1482,7 +1482,7 @@
"Could not check the NVIDIA GPU": "Kan inte kontrollera NVIDIA GPU", "Could not check the NVIDIA GPU": "Kan inte kontrollera NVIDIA GPU",
"Could not clone any gasket-driver repository. Check your internet connection and": "Kunde inte klona något gasket-driver-arkiv. Kontrollera internetanslutningen och", "Could not clone any gasket-driver repository. Check your internet connection and": "Kunde inte klona något gasket-driver-arkiv. Kontrollera internetanslutningen och",
"Could not complete or verify the repository switch; changes may be partial and repository state is unknown. Inspect {ui} before retrying; no automatic rollback was attempted.": "Det gick inte att slutföra eller verifiera bytet av arkiv; ändringarna kan vara ofullständiga och arkivens tillstånd är okänt. Granska {ui} innan du försöker igen; ingen automatisk återställning gjordes.", "Could not complete or verify the repository switch; changes may be partial and repository state is unknown. Inspect {ui} before retrying; no automatic rollback was attempted.": "Det gick inte att slutföra eller verifiera bytet av arkiv; ändringarna kan vara ofullständiga och arkivens tillstånd är okänt. Granska {ui} innan du försöker igen; ingen automatisk återställning gjordes.",
"Could not complete private network release:": "Kunde inte slutföra det privata nätverket:", "Could not complete private network release:": "Kunde inte slutföra frigörandet av det privata nätverket:",
"Could not configure IOMMU kernel parameters automatically. Configure manually and reboot.": "Kunde inte konfigurera IOMMU kärnparametrar automatiskt. Konfigurera manuellt och starta om.", "Could not configure IOMMU kernel parameters automatically. Configure manually and reboot.": "Kunde inte konfigurera IOMMU kärnparametrar automatiskt. Konfigurera manuellt och starta om.",
"Could not configure the tmpfs mounts": "Kunde inte konfigurera tmpfs-monteringarna", "Could not configure the tmpfs mounts": "Kunde inte konfigurera tmpfs-monteringarna",
"Could not convert the OCI rootfs to privileged": "Kunde inte konvertera OCI rootfs till privilegierad", "Could not convert the OCI rootfs to privileged": "Kunde inte konvertera OCI rootfs till privilegierad",
@@ -5275,10 +5275,10 @@
"Private network assigned automatically:": "Privat nätverk tilldelas automatiskt:", "Private network assigned automatically:": "Privat nätverk tilldelas automatiskt:",
"Private network kept, because other containers still use it:": "Privat nätverk behålls, eftersom andra behållare fortfarande använder det:", "Private network kept, because other containers still use it:": "Privat nätverk behålls, eftersom andra behållare fortfarande använder det:",
"Private network kept, because other guests still use it:": "Privat nätverk behålls, eftersom andra VM eller CT fortfarande använder det:", "Private network kept, because other guests still use it:": "Privat nätverk behålls, eftersom andra VM eller CT fortfarande använder det:",
"Private network of the application released:": "Privat nätverk av programmet som släppts:", "Private network of the application released:": "Programmets privata nätverk har frigjorts:",
"Private network of the application that is released:": "Privat nätverk av programmet som släpps:", "Private network of the application that is released:": "Privat nätverk för programmet som frigörs:",
"Private network release attempted:": "Försök att släppa privata nätverk:", "Private network release attempted:": "Försök att släppa privata nätverk:",
"Private network targeted for release if no other guest uses it:": "Privat nätverk som är inriktat på release om ingen annan gäst använder det:", "Private network targeted for release if no other guest uses it:": "Privat nätverk som frigörs om ingen annan gäst använder det:",
"Private network:": "Privat nätverk:", "Private network:": "Privat nätverk:",
"Private personal knowledge management": "Privat personlig kunskapshantering", "Private personal knowledge management": "Privat personlig kunskapshantering",
"Privileged": "Privilegierad", "Privileged": "Privilegierad",
+3 -3
View File
@@ -363,9 +363,9 @@ def remove(root, vmid):
remove_host_state(member) remove_host_state(member)
msg_ok(f"{translate('Container removed:')} CT {member}") msg_ok(f"{translate('Container removed:')} CT {member}")
if bridge and not bridge_in_use(bridge, set(members)): if bridge and not bridge_in_use(bridge, set(members)):
released = release_bridge(bridge) if release_bridge(bridge):
msg_ok(f"{translate('Private network release attempted:')} {bridge}") msg_ok(f"{translate('Private network of the application released:')} {bridge}")
if not released: else:
msg_warn(f"{translate('Could not complete private network release:')} {bridge}") msg_warn(f"{translate('Could not complete private network release:')} {bridge}")
incomplete = True incomplete = True
elif bridge: elif bridge: