]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm:Added helper function to return a specific healthcheck
authorPaul Cuzner <pcuzner@redhat.com>
Fri, 19 Feb 2021 02:06:45 +0000 (15:06 +1300)
committerSage Weil <sage@newdream.net>
Tue, 16 Mar 2021 12:56:17 +0000 (07:56 -0500)
Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
(cherry picked from commit baa2c9313ade4dcd40e5b42e367ab4c0f8d4b9d9)

src/pybind/mgr/cephadm/configchecks.py

index 36d29c6e723fbfce41b5102795769a08a96b6c55..5f69c007eae17dedd88d5b55cf0bad704d3b6bf8 100644 (file)
@@ -242,6 +242,13 @@ class CephadmConfigChecks:
                 else:
                     self.log.debug("config_checks match module definition")
 
+    def lookup_check(self, key_value: str, key_name: str = 'name') -> Optional[CephadmCheckDefinition]:
+
+        for c in self.health_checks:
+            if getattr(c, key_name) == key_value:
+                return c
+        return None
+
     @property
     def defined_checks(self) -> int:
         return len(self.health_checks)