From dc621104fb13535d6d8c027b8777d7384cfd81b9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 16 Dec 2019 12:53:44 -0600 Subject: [PATCH] mgr/orchestrator_cli: make 'device ls' table formatting consistent - all caps headers - align left by default - reorder columns Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator_cli/module.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 5949ed910c0..1a003cbcaff 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -250,17 +250,21 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule): for host in completion.result: # type: orchestrator.InventoryNode out.append('Host {}:'.format(host.name)) table = PrettyTable( - ['Path', 'Type', 'Size', 'Available', 'Ceph Device ID', 'Reject Reasons'], + ['PATH', 'TYPE', 'SIZE', 'DEVICE', 'AVAIL', + 'REJECT REASONS'], border=False) - table._align['Path'] = 'l' + table.align = 'l' + table._align['SIZE'] = 'r' + table.left_padding_width = 0 + table.right_padding_width = 1 for d in host.devices.devices: # type: Device table.add_row( ( d.path, d.human_readable_type, format_bytes(d.sys_api.get('size', 0), 5, colored=False), - d.available, d.device_id, + d.available, ', '.join(d.rejected_reasons) ) ) -- 2.39.5