Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/__init__.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-18 16:15:41 +0000
committerGitHub <noreply@github.com>2021-11-18 16:15:41 +0000
commit4e3d2cff0cfa640b87d9c674bfc0ec65d8b147cd (patch)
treedb66971a9a87b6454783505e32a3f695a353bf8c /archinstall/__init__.py
parent69810abb16478889118bdba1fed5c572acf33b5a (diff)
parent08468dc1cc84be58c77b20f5dc0f8f48df95789c (diff)
Merged PR #736 - Partially addresses #710
Adding in a hard exception if `--config` can't be loaded when given.
Diffstat (limited to 'archinstall/__init__.py')
-rw-r--r--archinstall/__init__.py8
1 files changed, 7 insertions, 1 deletions
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