From caa83221a755e5d9f9284bbc8b5f4ddfa724c05c Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 18 Nov 2021 15:56:38 +0000 Subject: Added an exception if configuration cannot be loaded, to avoid confusion --- archinstall/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'archinstall') diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 30ed8667..a528922f 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -49,12 +49,15 @@ def initialize_arguments(): with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response: config = json.loads(response.read()) except Exception as e: - print(e) + raise ValueError(f"Could not load --config because: {e}") + if args.creds is not None: with open(args.creds) as file: config.update(json.load(file)) + # Installation can't be silent if config is not passed config["silent"] = args.silent + for arg in unknowns: if '--' == arg[:2]: if '=' in arg: @@ -62,9 +65,12 @@ def initialize_arguments(): else: key, val = arg[2:], True config[key] = val + config["script"] = args.script + if args.dry_run is not None: config["dry-run"] = args.dry_run + return config -- cgit v1.2.3-54-g00ecf From 08468dc1cc84be58c77b20f5dc0f8f48df95789c Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 18 Nov 2021 16:09:25 +0000 Subject: Fixed spelling error on variables --- archinstall/lib/systemd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archinstall') diff --git a/archinstall/lib/systemd.py b/archinstall/lib/systemd.py index 7f732c99..c3beafc0 100644 --- a/archinstall/lib/systemd.py +++ b/archinstall/lib/systemd.py @@ -96,7 +96,7 @@ class Boot: if shutdown.exit_code == 0: storage['active_boot'] = None else: - raise SysCallError(f"Could not shut down temporary boot of {self.instance}", level=logging.ERROR, fg="red") + raise SysCallError(f"Could not shut down temporary boot of {self.instance}: {shutdown}", exit_code=shutdown.exit_code) def __iter__(self): if self.session: -- cgit v1.2.3-54-g00ecf