Adding in a hard exception if `--config` can't be loaded when given.
This commit is contained in:
commit
4e3d2cff0c
|
|
@ -49,12 +49,15 @@ def initialize_arguments():
|
||||||
with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response:
|
with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response:
|
||||||
config = json.loads(response.read())
|
config = json.loads(response.read())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
raise ValueError(f"Could not load --config because: {e}")
|
||||||
|
|
||||||
if args.creds is not None:
|
if args.creds is not None:
|
||||||
with open(args.creds) as file:
|
with open(args.creds) as file:
|
||||||
config.update(json.load(file))
|
config.update(json.load(file))
|
||||||
|
|
||||||
# Installation can't be silent if config is not passed
|
# Installation can't be silent if config is not passed
|
||||||
config["silent"] = args.silent
|
config["silent"] = args.silent
|
||||||
|
|
||||||
for arg in unknowns:
|
for arg in unknowns:
|
||||||
if '--' == arg[:2]:
|
if '--' == arg[:2]:
|
||||||
if '=' in arg:
|
if '=' in arg:
|
||||||
|
|
@ -62,9 +65,12 @@ def initialize_arguments():
|
||||||
else:
|
else:
|
||||||
key, val = arg[2:], True
|
key, val = arg[2:], True
|
||||||
config[key] = val
|
config[key] = val
|
||||||
|
|
||||||
config["script"] = args.script
|
config["script"] = args.script
|
||||||
|
|
||||||
if args.dry_run is not None:
|
if args.dry_run is not None:
|
||||||
config["dry-run"] = args.dry_run
|
config["dry-run"] = args.dry_run
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class Boot:
|
||||||
if shutdown.exit_code == 0:
|
if shutdown.exit_code == 0:
|
||||||
storage['active_boot'] = None
|
storage['active_boot'] = None
|
||||||
else:
|
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):
|
def __iter__(self):
|
||||||
if self.session:
|
if self.session:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue