]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add by_type daemon retrieval method 36584/head
authorJoshua Schmid <jschmid@suse.de>
Wed, 12 Aug 2020 10:23:59 +0000 (12:23 +0200)
committerJoshua Schmid <jschmid@suse.de>
Wed, 12 Aug 2020 10:31:34 +0000 (12:31 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py

index 323ba5d11d2315238563d408e674a795ee8f4e7a..4b0154e75a56527d90e4c28ab728c8d3cf318064 100644 (file)
@@ -386,6 +386,15 @@ class HostCache():
                     result.append(d)
         return result
 
+    def get_daemons_by_type(self, service_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 d.daemon_type == service_type:
+                    result.append(d)
+        return result
+
     def get_daemon_names(self):
         # type: () -> List[str]
         r = []
index 0b3f2fd8204d89b0735ce3a199eafef7f5499974..cbbdb5d819aad640f8eb6d7d9d6bd1ff66a68fd3 100644 (file)
@@ -2525,7 +2525,7 @@ you may want to run:
         process_removal_queue().
         """
 
-        daemons: List[orchestrator.DaemonDescription] = self.cache.get_daemons_by_service('osd')
+        daemons: List[orchestrator.DaemonDescription] = self.cache.get_daemons_by_type('osd')
         to_remove_daemons = list()
         for daemon in daemons:
             if daemon.daemon_id in osd_ids: