Merge pull request #38211 from ricardoasmarques/sort-host-device-ls

mgr/orchestrator: Sort 'ceph orch device ls' by host

Reviewed-by: Thomas Bechtold <tbechtold@suse.com>
Reviewed-by: Sebastian Wagner <swagner@suse.com>
This commit is contained in:
Kefu Chai 2020-11-27 14:19:39 +08:00 committed by GitHub
commit f792e90374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,7 +405,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'