From: Sebastian Wagner Date: Fri, 11 Sep 2020 11:14:13 +0000 (+0200) Subject: mgr/cephadm: move _update_paused_health to serve.py X-Git-Tag: v15.2.8~14^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ab1fe29d64ca6b45a0c87d48bb059ec4d3b1509;p=ceph.git mgr/cephadm: move _update_paused_health to serve.py Signed-off-by: Sebastian Wagner (cherry picked from commit e927ccfdde6f90b893c8cbd73e17fad50a7d76d9) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index e7b4f2e4f7d2..06cd08997ff6 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -467,20 +467,6 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): 'who': entity, }) - def _update_paused_health(self): - if self.paused: - self.health_checks['CEPHADM_PAUSED'] = { - 'severity': 'warning', - 'summary': 'cephadm background work is paused', - 'count': 1, - 'detail': ["'ceph orch resume' to resume"], - } - self.set_health_checks(self.health_checks) - else: - if 'CEPHADM_PAUSED' in self.health_checks: - del self.health_checks['CEPHADM_PAUSED'] - self.set_health_checks(self.health_checks) - def config_notify(self): """ This method is called whenever one of our config options is changed. diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index bf402a980845..74cb760c086a 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -54,7 +54,7 @@ class CephadmServe: self._check_for_strays() - self.mgr._update_paused_health() + self._update_paused_health() if not self.mgr.paused: self.mgr.rm_util.process_removal_queue() @@ -84,6 +84,20 @@ class CephadmServe: ret = self.mgr.event.wait(sleep_interval) self.mgr.event.clear() + def _update_paused_health(self): + 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) + 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) + def _refresh_hosts_and_daemons(self) -> None: bad_hosts = [] failures = []