Skip to content

Commit a155e73

Browse files
committed
Hoist name printing for default pools to shared parent
Signed-off-by: mulhern <amulhern@redhat.com>
1 parent 70e02d1 commit a155e73

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/stratis_cli/_actions/_list_pool.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ def uuid_str(self, mopool: Any) -> str:
319319
"""
320320
return self.uuid_formatter(mopool.Uuid())
321321

322+
@staticmethod
323+
def name_str(mopool: Any) -> str:
324+
"""
325+
Return a string representation of the pool name.
326+
"""
327+
return mopool.Name()
328+
322329

323330
class DefaultDetail(Default): # pylint: disable=too-few-public-methods
324331
"""
@@ -349,7 +356,7 @@ def _print_detail_view(
349356
encrypted = mopool.Encrypted()
350357

351358
print(f"UUID: {self.uuid_str(mopool)}")
352-
print(f"Name: {mopool.Name()}")
359+
print(f"Name: {Default.name_str(mopool)}")
353360

354361
alert_summary = sorted(
355362
f"{code}: {code.summarize()}"
@@ -532,7 +539,7 @@ def gen_string(has_property: bool, code: str) -> str:
532539

533540
tables = [
534541
(
535-
mopool.Name(),
542+
Default.name_str(mopool),
536543
physical_size_triple(mopool),
537544
properties_string(mopool),
538545
self.uuid_str(mopool),

0 commit comments

Comments
 (0)