mirror of
https://github.com/xcat2/confluent.git
synced 2026-11-22 18:32:20 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user