]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: Sort 'ceph orch device ls' by host
authorRicardo Marques <rimarques@suse.com>
Fri, 20 Nov 2020 11:52:02 +0000 (11:52 +0000)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 7 Jan 2021 12:01:02 +0000 (13:01 +0100)
Signed-off-by: Ricardo Marques <rimarques@suse.com>
(cherry picked from commit c6e6eb5ef53278b9d0cc0198bc32a441ab8f9a81)

src/pybind/mgr/orchestrator/module.py

index 7b86e397daa677c5ae27c50f1e1513f62b92fc7f..bef69bcbe4f1ad1936295373af42c0773d9f75c9 100644 (file)
@@ -407,7 +407,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule):
             table._align['SIZE'] = 'r'
             table.left_padding_width = 0
             table.right_padding_width = 2
-            for host_ in completion.result:  # type: InventoryHost
+            for host_ in sorted(completion.result, key=lambda h: h.name):  # type: InventoryHost
                 for d in host_.devices.devices:  # type: Device
 
                     led_ident = 'N/A'