Skip to content

Commit

Permalink
Display filesystem revert information in detail view
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <amulhern@redhat.com>
  • Loading branch information
mulkieran committed Sep 10, 2024
1 parent 51a3001 commit 131eb93
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/stratis_cli/_actions/_list_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def display(self):
date_parser.parse(fs.Created()).astimezone().strftime("%b %d %Y %H:%M")
)

origin = get_property(fs.Origin(), self.uuid_formatter, "None")
origin = get_property(fs.Origin(), self.uuid_formatter, None)

print(f"UUID: {self.uuid_formatter(fs.Uuid())}")
print(f"Name: {fs.Name()}")
Expand All @@ -186,7 +186,10 @@ def display(self):
print()
print(f"Created: {created}")
print()
print(f"Snapshot origin: {origin}")
print(f'Snapshot origin: {"None" if origin is None else origin}')
if origin is not None:
scheduled = "Yes" if fs.MergeScheduled() else "No"
print(f" Revert scheduled: {scheduled}")
print()
print("Sizes:")
print(f" Logical size of thin device: {total}")
Expand Down
15 changes: 15 additions & 0 deletions tests/whitebox/integration/logical/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ def setUp(self):
RUNNER(command_line)
command_line = ["filesystem", "create", self._POOLNAMES[0], self._VOLUMES[1]]
RUNNER(command_line)
command_line = [
"filesystem",
"snapshot",
self._POOLNAMES[0],
self._VOLUMES[1],
self._VOLUMES[2],
]
RUNNER(command_line)
command_line = ["pool", "create", self._POOLNAMES[1]] + device_lists[1]
RUNNER(command_line)
command_line = ["filesystem", "create", self._POOLNAMES[1], self._VOLUMES[2]]
Expand Down Expand Up @@ -191,3 +199,10 @@ def test_list_fs_name_pool_name_not_match(self):
self.check_error(
DbusClientUniqueResultError, command_line, StratisCliErrorCodes.ERROR
)

def test_list_fs_name_snapshot(self):
"""
Test list detailed view of a snapshot to test printing of revert information.
"""
command_line = self._MENU + [self._POOLNAMES[0], f"--name={self._VOLUMES[2]}"]
TEST_RUNNER(command_line)

0 comments on commit 131eb93

Please sign in to comment.