Fixes additional encryption prompt even tho partitions was marked for encryption (#1264)
Corrected the check for partitions marked with `encrypt: true`
This commit is contained in:
parent
78449f75bc
commit
5c9bd235d3
|
|
@ -433,9 +433,10 @@ def disk_layouts() -> Optional[Dict[str, Any]]:
|
||||||
|
|
||||||
|
|
||||||
def encrypted_partitions(blockdevices :Dict[str, Any]) -> bool:
|
def encrypted_partitions(blockdevices :Dict[str, Any]) -> bool:
|
||||||
for partition in blockdevices.values():
|
for blockdevice in blockdevices.values():
|
||||||
if partition.get('encrypted', False):
|
for partition in blockdevice.get('partitions', []):
|
||||||
yield partition
|
if partition.get('encrypted', False):
|
||||||
|
yield partition
|
||||||
|
|
||||||
def find_partition_by_mountpoint(block_devices :List[BlockDevice], relative_mountpoint :str) -> Partition:
|
def find_partition_by_mountpoint(block_devices :List[BlockDevice], relative_mountpoint :str) -> Partition:
|
||||||
for device in block_devices:
|
for device in block_devices:
|
||||||
|
|
|
||||||
|
|
@ -204,14 +204,15 @@ class GlobalMenu(GeneralMenu):
|
||||||
# Then we need to identify which partitions to encrypt. This will default to / (root).
|
# Then we need to identify which partitions to encrypt. This will default to / (root).
|
||||||
if len(list(encrypted_partitions(storage['arguments'].get('disk_layouts', [])))) == 0:
|
if len(list(encrypted_partitions(storage['arguments'].get('disk_layouts', [])))) == 0:
|
||||||
for blockdevice in storage['arguments']['disk_layouts']:
|
for blockdevice in storage['arguments']['disk_layouts']:
|
||||||
for partition_index in select_encrypted_partitions(
|
if storage['arguments']['disk_layouts'][blockdevice].get('partitions'):
|
||||||
title="Select which partitions to encrypt:",
|
for partition_index in select_encrypted_partitions(
|
||||||
partitions=storage['arguments']['disk_layouts'][blockdevice]['partitions']
|
title="Select which partitions to encrypt:",
|
||||||
):
|
partitions=storage['arguments']['disk_layouts'][blockdevice]['partitions']
|
||||||
|
):
|
||||||
|
|
||||||
partition = storage['arguments']['disk_layouts'][blockdevice]['partitions'][partition_index]
|
partition = storage['arguments']['disk_layouts'][blockdevice]['partitions'][partition_index]
|
||||||
partition['encrypted'] = True
|
partition['encrypted'] = True
|
||||||
partition['!password'] = storage['arguments']['!encryption-password']
|
partition['!password'] = storage['arguments']['!encryption-password']
|
||||||
|
|
||||||
def _install_text(self):
|
def _install_text(self):
|
||||||
missing = len(self._missing_configs())
|
missing = len(self._missing_configs())
|
||||||
|
|
|
||||||
|
|
@ -374,8 +374,6 @@ def select_encrypted_partitions(
|
||||||
if len(partition_indexes) == 0:
|
if len(partition_indexes) == 0:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
title = _('Select which partitions to mark for formatting:')
|
|
||||||
|
|
||||||
# show current partition layout:
|
# show current partition layout:
|
||||||
if len(partitions):
|
if len(partitions):
|
||||||
title += current_partition_layout(partitions) + '\n'
|
title += current_partition_layout(partitions) + '\n'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue