From: Melissa Li
Date: Tue, 3 Aug 2021 17:40:39 +0000 (-0400)
Subject: mgr/cephadm: refactor `_update_paused_health` to use `set_health_warning` and `remove...
X-Git-Tag: v17.1.0~716^2~4
X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cfd6ad0af2feac3a7611067dd7e88fed1b315023;p=ceph.git
mgr/cephadm: refactor `_update_paused_health` to use `set_health_warning` and `remove_health_warning` helpers
Fixes: https://tracker.ceph.com/issues/44414
Signed-off-by: Melissa Li
---
diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py
index 1cf024fac310..1357d67fd327 100644
--- a/src/pybind/mgr/cephadm/serve.py
+++ b/src/pybind/mgr/cephadm/serve.py
@@ -135,17 +135,9 @@ class CephadmServe:
def _update_paused_health(self) -> None:
if self.mgr.paused:
- self.mgr.health_checks['CEPHADM_PAUSED'] = {
- 'severity': 'warning',
- 'summary': 'cephadm background work is paused',
- 'count': 1,
- 'detail': ["'ceph orch resume' to resume"],
- }
- self.mgr.set_health_checks(self.mgr.health_checks)
+ self.mgr.set_health_warning('CEPHADM_PAUSED', 'cephadm background work is paused', 1, ["'ceph orch resume' to resume"])
else:
- if 'CEPHADM_PAUSED' in self.mgr.health_checks:
- del self.mgr.health_checks['CEPHADM_PAUSED']
- self.mgr.set_health_checks(self.mgr.health_checks)
+ self.mgr.remove_health_warning('CEPHADM_PAUSED')
def _autotune_host_memory(self, host: str) -> None:
total_mem = self.mgr.cache.get_facts(host).get('memory_total_kb', 0)