From: Paul Cuzner Date: Fri, 19 Feb 2021 02:06:45 +0000 (+1300) Subject: mgr/cephadm:Added helper function to return a specific healthcheck X-Git-Tag: v17.1.0~2673^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=baa2c9313ade4dcd40e5b42e367ab4c0f8d4b9d9;p=ceph.git mgr/cephadm:Added helper function to return a specific healthcheck Signed-off-by: Paul Cuzner --- diff --git a/src/pybind/mgr/cephadm/configchecks.py b/src/pybind/mgr/cephadm/configchecks.py index 36d29c6e723f..5f69c007eae1 100644 --- a/src/pybind/mgr/cephadm/configchecks.py +++ b/src/pybind/mgr/cephadm/configchecks.py @@ -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)