From 84b009ec3b60499f00ac792a6532560ac86f83d6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 11 Nov 2019 12:33:03 -0600 Subject: [PATCH] mgr/orchestrator_cli: sort by service name This is more consistent when applied across hosts. Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator_cli/module.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 7cd699b258d25..59d44bea51c08 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), -- 2.39.5