diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 0c53578d9e9..394ee31afb2 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2224,18 +2224,19 @@ def list_daemons(detail=True, legacy_dir=None): out, err, code = call( [ container_path, 'inspect', - '--format', '{{.Id}},{{.Config.Image}},{{%s}}' % image_field, + '--format', '{{.Id}},{{.Config.Image}},{{%s}},{{index .Config.Labels "io.ceph.version"}}' % image_field, 'ceph-%s-%s' % (fsid, j) ], verbose_on_failure=False) if not code: - (container_id, image_name, image_id) = out.strip().split(',') + (container_id, image_name, image_id, version) = out.strip().split(',') image_id = normalize_container_id(image_id) - out, err, code = call( - [container_path, 'exec', container_id, - 'ceph', '-v']) - if not code and out.startswith('ceph version '): - version = out.split(' ')[2] + if not version: + out, err, code = call( + [container_path, 'exec', container_id, + 'ceph', '-v']) + if not code and out.startswith('ceph version '): + version = out.split(' ')[2] i['container_id'] = container_id i['container_image_name'] = image_name i['container_image_id'] = image_id diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 68a62bc47ac..dc37458f8ff 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1537,7 +1537,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): found = list(zip(*args))[0] if args else [] not_found = {osd_id for osd_id in osd_ids if 'osd.%s' % osd_id not in found} if not_found: - raise OrchestratorError('Unable to find ODS: %s' % not_found) + raise OrchestratorError('Unable to find OSD: %s' % not_found) return self._remove_daemon(args) def _create_daemon(self, daemon_type, daemon_id, host,