Safe dictionary retrieval

This commit is contained in:
Anton Hvornum 2021-11-16 15:17:42 +00:00
parent c16872531e
commit 2891265409
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]}")