From: Sage Weil Date: Mon, 11 Nov 2019 18:33:03 +0000 (-0600) Subject: mgr/orchestrator_cli: sort by service name X-Git-Tag: v15.1.0~936^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31539%2Fhead;p=ceph.git mgr/orchestrator_cli: sort by service name This is more consistent when applied across hosts. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 7cd699b258d2..59d44bea51c0 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -260,17 +260,13 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule): return HandleCommandResult(stdout=json.dumps(data)) else: table = PrettyTable( - ['TYPE', 'ID', 'HOST', 'CONTAINER', 'VERSION', 'STATUS', + ['NAME', 'HOST', 'CONTAINER', 'VERSION', 'STATUS', 'DESCRIPTION'], border=False) table.align = 'l' table.left_padding_width = 0 table.right_padding_width = 1 for s in sorted(services, key=lambda s: s.name()): - if s.service is None: - service_id = s.service_instance - else: - service_id = "{0}.{1}".format(s.service, s.service_instance) status = { -1: 'error', 0: 'stopped', @@ -279,8 +275,7 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule): }[s.status] table.add_row(( - s.service_type, - service_id, + s.name(), ukn(s.nodename), ukn(s.container_id), ukn(s.version),