Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/scripts
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-07-17 17:27:21 +1000
committerGitHub <noreply@github.com>2023-07-17 09:27:21 +0200
commit2f273868d416c3309191db8c616aae683d78370a (patch)
tree9b38c0b631774d50b037bda3cef764e8cdf740d8 /archinstall/scripts
parentc67bb0b549b35ce335941c9c1cbe22f99c28f7fe (diff)
Fix network settings loading from config file (#1921)
* Fix network config error and simplify code * Update schema and exmaple --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/scripts')
-rw-r--r--archinstall/scripts/guided.py11
-rw-r--r--archinstall/scripts/swiss.py9
2 files changed, 9 insertions, 11 deletions
diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py
index 7f9b9fd6..c8df590d 100644
--- a/archinstall/scripts/guided.py
+++ b/archinstall/scripts/guided.py
@@ -1,6 +1,6 @@
import os
from pathlib import Path
-from typing import Any, TYPE_CHECKING
+from typing import Any, TYPE_CHECKING, Optional
import archinstall
from archinstall import info, debug
@@ -14,7 +14,7 @@ from archinstall.lib.installer import Installer
from archinstall.lib.menu import Menu
from archinstall.lib.mirrors import use_mirrors, add_custom_mirrors
from archinstall.lib.models.bootloader import Bootloader
-from archinstall.lib.models.network_configuration import NetworkConfigurationHandler
+from archinstall.lib.models.network_configuration import NetworkConfiguration
from archinstall.lib.networking import check_mirror_reachable
from archinstall.lib.profile.profiles_handler import profile_handler
@@ -82,7 +82,7 @@ def ask_user_questions():
global_menu.enable('parallel downloads')
# Ask or Call the helper function that asks the user to optionally configure a network.
- global_menu.enable('nic')
+ global_menu.enable('network_config')
global_menu.enable('timezone')
@@ -158,11 +158,10 @@ def perform_installation(mountpoint: Path):
# If user selected to copy the current ISO network configuration
# Perform a copy of the config
- network_config = archinstall.arguments.get('nic', None)
+ network_config: Optional[NetworkConfiguration] = archinstall.arguments.get('network_config', None)
if network_config:
- handler = NetworkConfigurationHandler(network_config)
- handler.config_installer(
+ network_config.install_network_config(
installation,
archinstall.arguments.get('profile_config', None)
)
diff --git a/archinstall/scripts/swiss.py b/archinstall/scripts/swiss.py
index 375458a1..a2ab0549 100644
--- a/archinstall/scripts/swiss.py
+++ b/archinstall/scripts/swiss.py
@@ -95,7 +95,7 @@ class SwissMainMenu(GlobalMenu):
options_list = [
'mirror_config', 'disk_config',
'disk_encryption', 'swap', 'bootloader', 'hostname', '!root-password',
- '!users', 'profile_config', 'audio', 'kernels', 'packages', 'additional-repositories', 'nic',
+ '!users', 'profile_config', 'audio', 'kernels', 'packages', 'additional-repositories', 'network_config',
'timezone', 'ntp'
]
@@ -110,7 +110,7 @@ class SwissMainMenu(GlobalMenu):
options_list = [
'mirror_config','bootloader', 'hostname',
'!root-password', '!users', 'profile_config', 'audio', 'kernels',
- 'packages', 'additional-repositories', 'nic', 'timezone', 'ntp'
+ 'packages', 'additional-repositories', 'network_config', 'timezone', 'ntp'
]
mandatory_list = ['hostname']
@@ -222,11 +222,10 @@ def perform_installation(mountpoint: Path, exec_mode: ExecutionMode):
# If user selected to copy the current ISO network configuration
# Perform a copy of the config
- network_config = archinstall.arguments.get('nic', None)
+ network_config = archinstall.arguments.get('network_config', None)
if network_config:
- handler = models.NetworkConfigurationHandler(network_config)
- handler.config_installer(
+ network_config.install_network_config(
installation,
archinstall.arguments.get('profile_config', None)
)