]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator_cli: sort by service name 31539/head
authorSage Weil <sage@redhat.com>
Mon, 11 Nov 2019 18:33:03 +0000 (12:33 -0600)
committerSage Weil <sage@redhat.com>
Mon, 11 Nov 2019 18:33:03 +0000 (12:33 -0600)
This is more consistent when applied across hosts.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/orchestrator_cli/module.py

index 7cd699b258d25646eb2591911bc2422eb2938fdc..59d44bea51c08b5e2b83afc1f01b7ffe4ad91892 100644 (file)
@@ -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),