From: Sage Weil Date: Mon, 2 Mar 2020 15:00:11 +0000 (-0600) Subject: mgr/orch: include spec ref in ServiceDescription X-Git-Tag: v15.1.1~142^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8ee0991e5b4218163b548a71767c3959ca5dc30a;p=ceph-ci.git mgr/orch: include spec ref in ServiceDescription Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 1093677b513..29fce5d98ca 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1662,19 +1662,14 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): continue spec = None if dd.service_name() in self.spec_store.specs: - spec_presence = "present" spec = self.spec_store.specs[dd.service_name()] - else: - spec_presence = "absent" - if dd.daemon_type == 'osd': - spec_presence = "not applicable" if n not in sm: sm[n] = orchestrator.ServiceDescription( service_name=n, last_refresh=dd.last_refresh, container_image_id=dd.container_image_id, container_image_name=dd.container_image_name, - spec_presence=spec_presence, + spec=spec, ) if spec: sm[n].size = self._get_spec_size(spec) @@ -1693,7 +1688,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): continue sm[n] = orchestrator.ServiceDescription( service_name=n, - spec_presence='present', + spec=spec, size=self._get_spec_size(spec), running=0, ) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index de285f64c60..4f015993df3 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1469,8 +1469,8 @@ class ServiceDescription(object): service_url=None, last_refresh=None, size=0, - spec_presence='absent', - running=0): + running=0, + spec=None): # Not everyone runs in containers, but enough people do to # justify having the container_image_id (image hash) and container_image # (image name) @@ -1498,10 +1498,7 @@ class ServiceDescription(object): # datetime when this info was last refreshed self.last_refresh = last_refresh # type: Optional[datetime.datetime] - # status string to indicate the presence of a persistent servicespec - # possible strings are "absent", "present" and "not applicable" while - # the "not applicable" is mostly for OSDs. - self.spec_presence = spec_presence + self.spec = spec def service_type(self): if self.service_name: diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index bcc43f20bd3..eadbd1cd6ab 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -355,7 +355,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule): age, ukn(s.container_image_name), ukn(s.container_image_id)[0:12], - ukn(s.spec_presence) + 'present' if s.spec else '-', )) return HandleCommandResult(stdout=table.get_string())