From eb4f1ad21a4a8d973f32c5747e62dca4a5c9fefd Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sun, 1 Nov 2026 22:10:22 +0100 Subject: [PATCH] Fail clearly when confignet finds no network configuration tool Without netplan, nmcli or wicked the manager variable was never set and confignet died with a NameError. Say what is missing instead. Also pick netplan over nmcli in the retry pass, as the first pass does, instead of switching to NetworkManager on systems that have both. --- confluent_osdeploy/common/profile/scripts/confignet | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 2dd7d152..c6b51216 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -698,6 +698,9 @@ if __name__ == '__main__': nm = NetworkManager(devtypes, dc) elif os.path.exists('/usr/sbin/wicked'): nm = WickedManager() + else: + sys.stderr.write('No netplan, nmcli or wicked found, unable to configure the network\n') + sys.exit(1) retrynics = [] if ipaddress: dnsbynetname = {} @@ -731,7 +734,7 @@ if __name__ == '__main__': idxmap, devtypes = map_idx_to_name() if os.path.exists('/usr/sbin/netplan'): nm = NetplanManager(dc) - if os.path.exists('/usr/bin/nmcli'): + elif os.path.exists('/usr/bin/nmcli'): nm = NetworkManager(devtypes, dc) elif os.path.exists('/usr/sbin/wicked'): nm = WickedManager()