]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/orch: include spec ref in ServiceDescription
authorSage Weil <sage@redhat.com>
Mon, 2 Mar 2020 15:00:11 +0000 (09:00 -0600)
committerSage Weil <sage@redhat.com>
Tue, 3 Mar 2020 00:16:34 +0000 (18:16 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/orchestrator/module.py

index 1093677b513412ce7940926838102e784af25346..29fce5d98cafa4f656b476389408e1916a45d6a5 100644 (file)
@@ -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,
             )
index de285f64c60e00bc9fd7c38b4f36f966ea37fb88..4f015993df3beec4edcbc7fd6d838eac8ab3f603 100644 (file)
@@ -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:
index bcc43f20bd350474d5d10635f3138250f9c4502c..eadbd1cd6ab52f009e61e271120b4abaf439c91b 100644 (file)
@@ -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())