From: Sage Weil Date: Mon, 17 Feb 2020 14:59:38 +0000 (-0600) Subject: mgr/orchestrator_cli: sort host list X-Git-Tag: v15.1.1~374^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de1a7b93cd12dd4a800d25e575c199abcf184bc9;p=ceph.git mgr/orchestrator_cli: sort host list Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 7dd39931973ca..c0773687c4d3d 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -213,7 +213,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule): table.align = 'l' table.left_padding_width = 0 table.right_padding_width = 1 - for node in completion.result: + for node in sorted(completion.result, key=lambda h: h.name): table.add_row((node.name, node.addr, ' '.join(node.labels))) output = table.get_string() return HandleCommandResult(stdout=output)