From: Sage Weil Date: Mon, 11 Nov 2019 18:32:42 +0000 (-0600) Subject: mgr/orchestrator_cli: collapse TYPE and ID columns X-Git-Tag: v15.1.0~936^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1a3b9fab509e4fb5404cae29a973534cc7362d60;p=ceph-ci.git mgr/orchestrator_cli: collapse TYPE and ID columns Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index dc9e57f2fe9..ea96f7296b6 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -671,6 +671,11 @@ class ServiceDescription(object): # Service status description when status == -1. self.status_desc = status_desc + def name(self): + if self.service_instance: + return '%s.%s' % (self.service_type, self.service_instance) + return self.service_type + def to_json(self): out = { 'nodename': self.nodename, diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 6f9f3c30008..7cd699b258d 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -266,7 +266,7 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule): table.align = 'l' table.left_padding_width = 0 table.right_padding_width = 1 - for s in services: + for s in sorted(services, key=lambda s: s.name()): if s.service is None: service_id = s.service_instance else: