fix-2740 - Handle empty iface selection (#2747)
This commit is contained in:
parent
6553967be6
commit
4a06131f4d
|
|
@ -65,6 +65,10 @@ class ManualNetworkConfig(ListManager):
|
||||||
all_ifaces = list_interfaces().values()
|
all_ifaces = list_interfaces().values()
|
||||||
existing_ifaces = [d.iface for d in data]
|
existing_ifaces = [d.iface for d in data]
|
||||||
available = set(all_ifaces) - set(existing_ifaces)
|
available = set(all_ifaces) - set(existing_ifaces)
|
||||||
|
|
||||||
|
if not available:
|
||||||
|
return None
|
||||||
|
|
||||||
choice = Menu(str(_('Select interface to add')), list(available), skip=True).run()
|
choice = Menu(str(_('Select interface to add')), list(available), skip=True).run()
|
||||||
|
|
||||||
if choice.type_ == MenuSelectionType.Skip:
|
if choice.type_ == MenuSelectionType.Skip:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue