From: Paul Cuzner Date: Fri, 19 Feb 2021 02:09:02 +0000 (+1300) Subject: mgr/cephadm:Drop active healthcheck during a disable request X-Git-Tag: v16.2.0~106^2~75 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30ff5ae9aaae46559274365aa2a7db2de2fbdbaf;p=ceph.git mgr/cephadm:Drop active healthcheck during a disable request The healthcheck could already be active when the admin attempts to disable it. This patch removes the related healthcheck if it's set during a config-check disable request. Signed-off-by: Paul Cuzner (cherry picked from commit f3cf41f98955a2c3b8c31374981e5ecbf5d4eda9) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 9a09887a0896b..119fd12943d7a 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1126,6 +1126,16 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, err, msg = self._update_config_check(check_name, 'disabled') if err: return HandleCommandResult(retval=err, stderr=f"Failed to disable check '{check_name}': {msg}") + else: + # drop any outstanding raised healthcheck for this check + config_check = self.config_checker.lookup_check(check_name) + if config_check: + if config_check.healthcheck_name in self.health_checks: + self.health_checks.pop(config_check.healthcheck_name, None) + self.set_health_checks(self.health_checks) + else: + self.log.error( + f"Unable to resolve a check name ({check_name}) to a healthcheck definition?") return HandleCommandResult(stdout="ok")