]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: combine get_daemons_by_daemon -> get_daemons_by_service 33496/head
authorSage Weil <sage@redhat.com>
Mon, 24 Feb 2020 16:45:37 +0000 (10:45 -0600)
committerSage Weil <sage@redhat.com>
Mon, 24 Feb 2020 16:46:10 +0000 (10:46 -0600)
These were the same.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 2c5122f32ddfdc2484b7598ee961bc4b9285b551..7fcc48f8925eb75c7b4843b7931a83798ab6788a 100644 (file)
@@ -213,15 +213,6 @@ class HostCache():
                 r.append(dd)
         return r
 
-    def get_daemons_by_type(self, daemon_type):
-        # type: (str) -> List[orchestrator.DaemonDescription]
-        result = []   # type: List[orchestrator.DaemonDescription]
-        for host, dm in self.daemons.items():
-            for name, d in dm.items():
-                if name.startswith(daemon_type + '.'):
-                    result.append(d)
-        return result
-
     def get_daemons_by_service(self, service_name):
         # type: (str) -> List[orchestrator.DaemonDescription]
         result = []   # type: List[orchestrator.DaemonDescription]
@@ -2172,7 +2163,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
                 port = t.split(':')[1]
             # get standbys too.  assume that they are all on the same port
             # as the active.
-            for dd in self.cache.get_daemons_by_type('mgr'):
+            for dd in self.cache.get_daemons_by_service('mgr'):
                 if dd.daemon_id == self.get_mgr_id():
                     continue
                 hi = self.inventory.get(dd.hostname, None)
@@ -2182,7 +2173,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
 
         # scrape node exporters
         node_configs = ''
-        for dd in self.cache.get_daemons_by_type('node-exporter'):
+        for dd in self.cache.get_daemons_by_service('node-exporter'):
             hi = self.inventory.get(dd.hostname, None)
             if hi:
                 addr = hi.get('addr', dd.hostname)