Merge PR #722 - Fixes #721

Safe dictionary retrieval
This commit is contained in:
Anton Hvornum 2021-11-16 15:18:17 +00:00 committed by GitHub
commit 8799973895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ class Installer:
for mountpoint in sorted(mountpoints.keys()):
log(f"Mounting {mountpoint} to {self.target}{mountpoint}", level=logging.INFO)
if mountpoints[mountpoint]['encrypted']:
if mountpoints[mountpoint].get('encrypted', False):
loopdev = storage.get('ENC_IDENTIFIER', 'ai') + 'loop'
if not (password := mountpoints[mountpoint].get('!password', None)):
raise RequirementError(f"Missing mountpoint {mountpoint} encryption password in layout: {mountpoints[mountpoint]}")