]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/orchestrator_cli: make 'device ls' table formatting consistent
authorSage Weil <sage@redhat.com>
Mon, 16 Dec 2019 18:53:44 +0000 (12:53 -0600)
committerSage Weil <sage@redhat.com>
Mon, 16 Dec 2019 18:58:24 +0000 (12:58 -0600)
- all caps headers
- align left by default
- reorder columns

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/orchestrator_cli/module.py

index 5949ed910c015ada7cb308761730ea688d1d0427..1a003cbcaff1a72e9a65044ed08f30a3c3ad6664 100644 (file)
@@ -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)
                         )
                     )