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>2022-05-12 10:46:33 +0200
committerGitHub <noreply@github.com>2022-05-12 10:46:33 +0200
commit81b7524b53fe21664ec6da3b69e507638b1ed253 (patch)
tree052731d836328ac06b0344df6bd73d7ab7a26cd4 /archinstall/__init__.py
parent08452de09c8461178e27da27633778910a4e1b7a (diff)
Made sure remote sourcing works for --creds, --config and --disk-layout. (#1170)
* Made sure remote sourcing works for --creds, --config and --disk-layout. * Spelling error when moving around source code.
Diffstat (limited to 'archinstall/__init__.py')
-rw-r--r--archinstall/__init__.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index 536db370..aa644d48 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -149,22 +149,13 @@ def get_arguments() -> Dict[str, Any]:
# preprocess the json files.
# TODO Expand the url access to the other JSON file arguments ?
if args.config is not None:
- try:
- # First, let's check if this is a URL scheme instead of a filename
- parsed_url = urllib.parse.urlparse(args.config)
-
- if not parsed_url.scheme: # The Profile was not a direct match on a remote URL, it must be a local file.
- if not json_stream_to_structure('--config',args.config,config):
- exit(1)
- else: # Attempt to load the configuration from the URL.
- with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response:
- config.update(json.loads(response.read()))
- except Exception as e:
- raise ValueError(f"Could not load --config because: {e}")
+ if not json_stream_to_structure('--config', args.config, config):
+ exit(1)
- if args.creds is not None:
- if not json_stream_to_structure('--creds',args.creds,config):
- exit(1)
+ if args.creds is not None:
+ if not json_stream_to_structure('--creds', args.creds, config):
+ exit(1)
+
# load the parameters. first the known, then the unknowns
config.update(vars(args))
config.update(parse_unspecified_argument_list(unknowns))