Make network configuration mandatory with explicit "No network" option
This commit is contained in:
parent
b2f413124b
commit
de709d7c46
|
|
@ -134,6 +134,7 @@ class GlobalMenu(AbstractMenu[None]):
|
|||
action=select_network,
|
||||
value={},
|
||||
preview_action=self._prev_network_config,
|
||||
mandatory=True,
|
||||
key='network_config',
|
||||
),
|
||||
MenuItem(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class NicType(Enum):
|
|||
NM = 'nm'
|
||||
NM_IWD = 'nm_iwd'
|
||||
MANUAL = 'manual'
|
||||
NONE = 'none'
|
||||
|
||||
def display_msg(self) -> str:
|
||||
match self:
|
||||
|
|
@ -23,6 +24,8 @@ class NicType(Enum):
|
|||
return tr('Use Network Manager (iwd backend)')
|
||||
case NicType.MANUAL:
|
||||
return tr('Manual configuration')
|
||||
case NicType.NONE:
|
||||
return tr('No network')
|
||||
|
||||
|
||||
class _NicSerialization(TypedDict):
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ def install_network_config(
|
|||
installation.configure_nic(nic)
|
||||
installation.enable_service('systemd-networkd')
|
||||
installation.enable_service('systemd-resolved')
|
||||
case NicType.NONE:
|
||||
pass
|
||||
|
||||
|
||||
def _configure_nm_iwd(installation: Installer) -> None:
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ async def select_network(preset: NetworkConfiguration | None) -> NetworkConfigur
|
|||
"""
|
||||
|
||||
items = [MenuItem(n.display_msg(), value=n) for n in NicType]
|
||||
group = MenuItemGroup(items, sort_items=True)
|
||||
group = MenuItemGroup(items, sort_items=False)
|
||||
|
||||
if preset:
|
||||
group.set_selected_by_value(preset.type)
|
||||
|
|
@ -205,5 +205,7 @@ async def select_network(preset: NetworkConfiguration | None) -> NetworkConfigur
|
|||
|
||||
if nics:
|
||||
return NetworkConfiguration(NicType.MANUAL, nics)
|
||||
case NicType.NONE:
|
||||
return NetworkConfiguration(NicType.NONE)
|
||||
|
||||
return preset
|
||||
|
|
|
|||
|
|
@ -633,6 +633,9 @@ msgstr ""
|
|||
msgid "Manual configuration"
|
||||
msgstr ""
|
||||
|
||||
msgid "No network"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark/Unmark a partition as compressed (btrfs only)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -646,6 +646,9 @@ msgstr "Оберіть інтерфейс для додавання"
|
|||
msgid "Manual configuration"
|
||||
msgstr "Ручне налаштування"
|
||||
|
||||
msgid "No network"
|
||||
msgstr "Без мережі"
|
||||
|
||||
msgid "Mark/Unmark a partition as compressed (btrfs only)"
|
||||
msgstr "Позначити/зняти позначку розділу як стисненого (лише btrfs)"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue