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