Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-14 15:28:46 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-14 15:28:46 +0100
commit502968b579160b4df9f5cbd66c8f6e96c2f8d2b4 (patch)
tree2cd532b3c383d6976e695faec7627e991c06fe3b /examples/guided.py
parent40440e575caf28d55cead7c16871e03cd9afc0c1 (diff)
Added some error handling to disk encryption passwords.
Diffstat (limited to 'examples/guided.py')
-rw-r--r--examples/guided.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 40ac7ca8..96243a1b 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -94,7 +94,7 @@ def ask_user_questions():
old_password = archinstall.arguments.get('!encryption-password', None)
if not old_password:
old_password = input(f'Enter the old encryption password for {partition}: ')
-
+
if (autodetected_filesystem := partition.detect_inner_filesystem(old_password)):
new_filesystem = autodetected_filesystem
else:
@@ -134,8 +134,9 @@ def ask_user_questions():
# Get disk encryption password (or skip if blank)
if not archinstall.arguments.get('!encryption-password', None):
- archinstall.arguments['!encryption-password'] = archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')
- archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['!encryption-password']
+ if passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): '):
+ archinstall.arguments['!encryption-password'] = passwd
+ archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['!encryption-password']
# Get the hostname for the machine
if not archinstall.arguments.get('hostname', None):