Move get_install_warnings() from ConfigurationOutput to GlobalMenu
The method is only used by GlobalMenu._prev_install_invalid_config(), so it belongs there rather than on the serialization class.
This commit is contained in:
parent
ec6bd6df8c
commit
9c40f8e9ae
|
|
@ -11,7 +11,6 @@ from archinstall.lib.crypt import encrypt
|
|||
from archinstall.lib.log import debug, logger, warn
|
||||
from archinstall.lib.menu.helpers import Confirmation, Selection
|
||||
from archinstall.lib.menu.util import get_password, prompt_dir
|
||||
from archinstall.lib.models.network import NetworkConfiguration
|
||||
from archinstall.lib.translationhandler import tr
|
||||
from archinstall.lib.utils.format import as_key_value_pair
|
||||
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
|
||||
|
|
@ -104,14 +103,6 @@ class ConfigurationOutput:
|
|||
|
||||
return True
|
||||
|
||||
def get_install_warnings(self) -> list[str]:
|
||||
warnings: list[str] = []
|
||||
|
||||
if not isinstance(self._config.network_config, NetworkConfiguration):
|
||||
warnings.append(tr('No network configuration selected. Network will need to be set up manually on the installed system.'))
|
||||
|
||||
return warnings
|
||||
|
||||
def _is_valid_path(self, dest_path: Path) -> bool:
|
||||
dest_path_ok = dest_path.exists() and dest_path.is_dir()
|
||||
if not dest_path_ok:
|
||||
|
|
|
|||
|
|
@ -494,11 +494,19 @@ class GlobalMenu(AbstractMenu[None]):
|
|||
|
||||
return None
|
||||
|
||||
def _get_install_warnings(self) -> list[str]:
|
||||
warnings: list[str] = []
|
||||
|
||||
if not isinstance(self._arch_config.network_config, NetworkConfiguration):
|
||||
warnings.append(tr('No network configuration selected. Network will need to be set up manually on the installed system.'))
|
||||
|
||||
return warnings
|
||||
|
||||
def _prev_install_invalid_config(self, item: MenuItem) -> str | PreviewResult | list[PreviewResult] | None:
|
||||
self.sync_all_to_config()
|
||||
config_output = ConfigurationOutput(self._arch_config)
|
||||
|
||||
warnings = config_output.get_install_warnings()
|
||||
warnings = self._get_install_warnings()
|
||||
sections: list[PreviewResult] = []
|
||||
|
||||
errors = ''
|
||||
|
|
|
|||
Loading…
Reference in New Issue