Merge pull request #123 from Torxed/torxed-v2.2.3

Reverting .strip() logic and moving the check into the get_password()…
This commit is contained in:
Anton Hvornum 2021-03-29 08:21:42 +00:00 committed by GitHub
commit 4c5be61918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,10 @@ def get_password(prompt="Enter a password: "):
if passwd != passwd_verification:
log(' * Passwords did not match * ', bg='black', fg='red')
continue
if len(passwd.strip()) <= 0:
break
return passwd
return None

View File

@ -139,7 +139,7 @@ def ask_user_questions():
# Get disk encryption password (or skip if blank)
if not archinstall.arguments.get('!encryption-password', None):
if (passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')).strip():
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']