]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add by_type daemon retrieval method
authorJoshua Schmid <jschmid@suse.de>
Wed, 12 Aug 2020 10:23:59 +0000 (12:23 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 21 Aug 2020 11:04:01 +0000 (13:04 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
(cherry picked from commit 1f8965f8cc48c9e901f3531259d446e3d9211135)

src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py

index 6fc450e99895f9eb76199ff6865b4021b8df2195..3780e749f72d618209cc32bbb9545868dc5acfee 100644 (file)
@@ -388,6 +388,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 74624085dc50829fc7b94c94192bd5f22b78589e..743651c0f7b984ababf2d2605eb84ce056f6b951 100644 (file)
@@ -2526,7 +2526,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: