Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-11 18:00:37 +0000
committerGitHub <noreply@github.com>2021-11-11 18:00:37 +0000
commit9b944b90b151a616e36f7361c7cf3c6951e61970 (patch)
tree5f8a253d198b89b32fce4103967053ee93a98ead
parente3e62039f9c4cbbb6f604c838cd3cd8032150565 (diff)
parentb22500babdc6bf6f99acb771b87411fe979aa1d5 (diff)
Merged PR #713 - Fixes #712
Removed assumptions that !user and !super-users exists.
-rw-r--r--examples/guided.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/guided.py b/examples/guided.py
index f009d938..0d56540a 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -243,13 +243,13 @@ def perform_filesystem_operations():
fs.load_layout(archinstall.storage['disk_layouts'][drive.path])
def perform_installation(mountpoint):
- user_credentials = {
- "!users" : archinstall.arguments['!users'],
- "!superusers" : archinstall.arguments['!superusers'],
- "!root-password" : archinstall.arguments['!root-password'],
- }
+ user_credentials = {}
+ if archinstall.arguments.get('!users'):
+ user_credentials["!users"] = archinstall.arguments['!users']
+ if archinstall.arguments.get('!superusers'):
+ user_credentials["!superusers"] = archinstall.arguments['!superusers']
if archinstall.arguments.get('!encryption-password'):
- user_credentials["!encryption-password"] = archinstall.arguments.get('!encryption-password')
+ user_credentials["!encryption-password"] = archinstall.arguments['!encryption-password']
with open("/var/log/archinstall/user_credentials.json", "w") as config_file:
config_file.write(json.dumps(user_credentials, indent=4, sort_keys=True, cls=archinstall.UNSAFE_JSON))