From 419b058b6f663e75f4df9a33b87d06f7722dc82a Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Sun, 6 Jun 2021 08:18:34 +0530 Subject: added support for seperating credentials from config --- archinstall/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 0b799d5b..84cf24a2 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -30,6 +30,7 @@ storage['__version__'] = __version__ def initialize_arguments(): config = {} parser.add_argument("--config", nargs="?", help="JSON configuration file or URL") + parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file or URL") parser.add_argument("--silent", action="store_true", help="Warning!!! No prompts, ignored if config is not passed") parser.add_argument("--script", default="guided", nargs="?", help="Script to run for installation", type=str) @@ -42,6 +43,9 @@ def initialize_arguments(): if not parsed_url.scheme: # The Profile was not a direct match on a remote URL, it must be a local file. with open(args.config) as file: config = json.load(file) + if args.creds is not None: + with open(args.creds) as file: + config.update(json.load(file)) 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 = json.loads(response.read()) -- cgit v1.2.3-54-g00ecf From 158dbbf8f19b2a4528cd267e38a21297d93012dd Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Sun, 6 Jun 2021 08:35:26 +0530 Subject: changed block location --- archinstall/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 84cf24a2..16de1876 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -43,14 +43,14 @@ def initialize_arguments(): if not parsed_url.scheme: # The Profile was not a direct match on a remote URL, it must be a local file. with open(args.config) as file: config = json.load(file) - if args.creds is not None: - with open(args.creds) as file: - config.update(json.load(file)) 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 = json.loads(response.read()) except Exception as e: print(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: -- cgit v1.2.3-54-g00ecf From 9bec42ad0835864eee47b6b17c486930b672f29f Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Sun, 6 Jun 2021 08:41:37 +0530 Subject: updated creds help --- archinstall/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 16de1876..bbad316d 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -30,7 +30,7 @@ storage['__version__'] = __version__ def initialize_arguments(): config = {} parser.add_argument("--config", nargs="?", help="JSON configuration file or URL") - parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file or URL") + parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file") parser.add_argument("--silent", action="store_true", help="Warning!!! No prompts, ignored if config is not passed") parser.add_argument("--script", default="guided", nargs="?", help="Script to run for installation", type=str) -- cgit v1.2.3-54-g00ecf