From f32bf931a7cdd503f297d3b680e896c1e1efca3c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Mar 2020 18:56:30 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/cephadm/module.py | 3 +++ src/pybind/mgr/orchestrator/module.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 5d20c393e74..5b73438c250 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 7dcbb228943..7c459de0cc9 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()) -- 2.39.5