Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-11-11 20:37:36 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-11-11 20:37:36 +0000
commita9099cbb466ef3db0e44779b0f9108674632e4c4 (patch)
tree32b91132ae12f54be6ed6d988216310e4086d413
parent9ad56f3462f8de25e8cae8905a5b04e228aef071 (diff)
Added key error correction again by creating default value. Should do this for all of them really.
-rw-r--r--examples/guided.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 9c5f083e..95b5d173 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -58,14 +58,15 @@ def perform_installation(device, boot_partition, language, mirrors):
if 'profile' in archinstall.storage['_guided'] and len(profile := archinstall.storage['_guided']['profile']['path'].strip()):
installation.install_profile(profile)
- for user in archinstall.storage['_guided']['users']:
- password = users[user]
+ if archinstall.storage['_guided']['users']:
+ for user in archinstall.storage['_guided']['users']:
+ password = users[user]
- sudo = False
- if 'root_pw' not in archinstall.storage['_guided_hidden'] or len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0:
- sudo = True
+ sudo = False
+ if 'root_pw' not in archinstall.storage['_guided_hidden'] or len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0:
+ sudo = True
- installation.user_create(user, password, sudo=sudo)
+ installation.user_create(user, password, sudo=sudo)
if 'root_pw' in archinstall.storage['_guided_hidden'] and archinstall.storage['_guided_hidden']['root_pw']:
installation.user_set_pw('root', archinstall.storage['_guided_hidden']['root_pw'])
@@ -124,6 +125,7 @@ new_user_text = 'Any additional users to install (leave blank for no users): '
if len(root_pw.strip()) == 0:
new_user_text = 'Create a super-user with sudo privileges: '
+archinstall.storage['_guided']['users'] = None
while 1:
new_user = input(new_user_text)
if len(new_user.strip()) == 0: