From: Sage Weil Date: Tue, 19 Jan 2021 22:31:25 +0000 (-0600) Subject: mgr/cephadm: fix host maintenance health check update X-Git-Tag: v17.0.0~6^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=315f58bee20154a7e83cb65f301dce4e22f9c9f6;p=ceph.git mgr/cephadm: fix host maintenance health check update We need to update the self.health_checks dict and use that or else we will clobber any other exising checks. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index e0e26ce3f4a..07347f1d26e 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1283,18 +1283,15 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, in_maintenance = self.inventory.get_host_with_state("maintenance") if not in_maintenance: - self.set_health_checks({ - "HOST_IN_MAINTENANCE": {} - }) + del self.health_checks["HOST_IN_MAINTENANCE"] else: s = "host is" if len(in_maintenance) == 1 else "hosts are" - self.set_health_checks({ - "HOST_IN_MAINTENANCE": { - "severity": "warning", - "summary": f"{len(in_maintenance)} {s} in maintenance mode", - "detail": [f"{h} is in maintenance" for h in in_maintenance], - } - }) + self.health_checks["HOST_IN_MAINTENANCE"] = { + "severity": "warning", + "summary": f"{len(in_maintenance)} {s} in maintenance mode", + "detail": [f"{h} is in maintenance" for h in in_maintenance], + } + self.set_health_checks(self.health_checks) @trivial_completion @host_exists()