From 6ab1fe29d64ca6b45a0c87d48bb059ec4d3b1509 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 11 Sep 2020 13:14:13 +0200 Subject: [PATCH] mgr/cephadm: move _update_paused_health to serve.py Signed-off-by: Sebastian Wagner (cherry picked from commit e927ccfdde6f90b893c8cbd73e17fad50a7d76d9) --- src/pybind/mgr/cephadm/module.py | 14 -------------- src/pybind/mgr/cephadm/serve.py | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index e7b4f2e4f7d2b..06cd08997ff68 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 bf402a9808452..74cb760c086a9 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 = [] -- 2.39.5