From 448dcc0a875f72835bfaa603abab23a02df3a879 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Feb 2020 10:45:37 -0600 Subject: [PATCH] mgr/cephadm: combine get_daemons_by_daemon -> get_daemons_by_service These were the same. Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 2c5122f32dd..7fcc48f8925 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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) -- 2.47.3