Skip to content

Commit

Permalink
Make detail view for started and stopped pools similar
Browse files Browse the repository at this point in the history
Particularly, if pool is not encrypted, do not list encryption-related
information.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jun 10, 2024
1 parent 7349cb8 commit 8587c8c
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/stratis_cli/_actions/_list_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,24 +267,22 @@ def _print_detail_view(self, mopool, size_change_codes):
f"{'Yes' if mopool.Overprovisioning() else 'No'}"
)

key_description_str = (
_non_existent_or_inconsistent_to_str(
if encrypted:
print("Encryption enabled: Yes")

key_description_str = _non_existent_or_inconsistent_to_str(
EncryptionInfoKeyDescription(mopool.KeyDescription())
)
if encrypted
else "<UNENCRYPTED>"
)
print(f"Key Description: {key_description_str}")
print(f" Key Description: {key_description_str}")

clevis_info_str = (
_non_existent_or_inconsistent_to_str(
clevis_info_str = _non_existent_or_inconsistent_to_str(
EncryptionInfoClevis(mopool.ClevisInfo()),
interp=_clevis_to_str, # pyright: ignore [ reportArgumentType ]
)
if encrypted
else "<UNENCRYPTED>"
)
print(f"Clevis Configuration: {clevis_info_str}")
print(f" Clevis Configuration: {clevis_info_str}")

else:
print("Encryption enabled: No")

total_physical_used = get_property(mopool.TotalPhysicalUsed(), Range, None)

Expand Down

0 comments on commit 8587c8c

Please sign in to comment.