diff options
author | Sage Weil <sage@redhat.com> | 2020-03-10 23:56:30 +0100 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2020-03-12 22:10:35 +0100 |
commit | f32bf931a7cdd503f297d3b680e896c1e1efca3c (patch) | |
tree | bf0bc2fc70a724fdb102483e19dd8f9156caaa84 | |
parent | mgr/rook: include container_image_name in 'orch ps' (diff) | |
download | ceph-f32bf931a7cdd503f297d3b680e896c1e1efca3c.tar.xz ceph-f32bf931a7cdd503f297d3b680e896c1e1efca3c.zip |
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 <sage@redhat.com>
-rw-r--r-- | src/pybind/mgr/cephadm/module.py | 3 | ||||
-rw-r--r-- | src/pybind/mgr/orchestrator/module.py | 2 |
2 files changed, 4 insertions, 1 deletions
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()) |