From 01ffd253450defa945db6e18ffe2328810172bd8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 13 Mar 2020 13:52:50 -0500 Subject: [PATCH] mgr/orch: orch ls: show or as appropriate Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator/module.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 71fa6d4fd81..f188b49d846 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -356,12 +356,18 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule): table.left_padding_width = 0 table.right_padding_width = 2 for s in sorted(services, key=lambda s: s.service_name): + if not s.spec: + pl = '' + elif s.spec.unmanaged: + pl = '' + else: + pl = s.spec.placement.pretty_str() table.add_row(( s.service_name, '%d/%d' % (s.running, s.size), nice_delta(now, s.last_refresh, ' ago'), nice_delta(now, s.created), - s.spec.placement.pretty_str() if s.spec else '-', + pl, ukn(s.container_image_name), ukn(s.container_image_id)[0:12], )) -- 2.39.5