(self)
| 123 | |
| 124 | @override |
| 125 | async def show(self) -> DiskEncryption | None: |
| 126 | enc_config = await super().show() |
| 127 | if enc_config is None: |
| 128 | return None |
| 129 | |
| 130 | enc_type: EncryptionType | None = self._item_group.find_by_key('encryption_type').value |
| 131 | enc_password: Password | None = self._item_group.find_by_key('encryption_password').value |
| 132 | iter_time: int | None = self._item_group.find_by_key('iter_time').value |
| 133 | enc_partitions = self._item_group.find_by_key('partitions').value |
| 134 | enc_lvm_vols = self._item_group.find_by_key('lvm_volumes').value |
| 135 | |
| 136 | assert enc_type is not None |
| 137 | assert enc_partitions is not None |
| 138 | assert enc_lvm_vols is not None |
| 139 | |
| 140 | if enc_type in [EncryptionType.LUKS, EncryptionType.LVM_ON_LUKS] and enc_partitions: |
| 141 | enc_lvm_vols = [] |
| 142 | |
| 143 | if enc_type == EncryptionType.LUKS_ON_LVM: |
| 144 | enc_partitions = [] |
| 145 | |
| 146 | if enc_type != EncryptionType.NO_ENCRYPTION and enc_password and (enc_partitions or enc_lvm_vols): |
| 147 | return DiskEncryption( |
| 148 | encryption_password=enc_password, |
| 149 | encryption_type=enc_type, |
| 150 | partitions=enc_partitions, |
| 151 | lvm_volumes=enc_lvm_vols, |
| 152 | hsm_device=enc_config.hsm_device, |
| 153 | iter_time=iter_time or DEFAULT_ITER_TIME, |
| 154 | ) |
| 155 | |
| 156 | return None |
| 157 | |
| 158 | def _preview(self, item: MenuItem) -> str | None: |
| 159 | output = '' |
no test coverage detected