From: Sage Weil Date: Tue, 10 Mar 2020 22:56:30 +0000 (-0400) Subject: mgr/orch: shorten container_id (hash) in cephadm, not orch ps X-Git-Tag: v15.1.1~8^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f32bf931a7cdd503f297d3b680e896c1e1efca3c;p=ceph.git mgr/orch: shorten container_id (hash) in cephadm, not orch ps This lets us present a longer, human-readable id for rook. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 5d20c393e74d..5b73438c250b 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1639,6 +1639,9 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): sd.daemon_id = '.'.join(d['name'].split('.')[1:]) sd.hostname = host sd.container_id = d.get('container_id') + if sd.container_id: + # shorten the hash + sd.container_id = sd.container_id[0:12] sd.container_image_name = d.get('container_image_name') sd.container_image_id = d.get('container_image_id') sd.version = d.get('version') diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 7dcbb2289439..7c459de0cc93 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -423,7 +423,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule): ukn(s.version), ukn(s.container_image_name), ukn(s.container_image_id)[0:12], - ukn(s.container_id)[0:12])) + ukn(s.container_id))) return HandleCommandResult(stdout=table.get_string())