mirror of
https://github.com/ceph/ceph
synced 2024-12-30 07:23:11 +00:00
mgr/cephadm: Add CEPHADM_PAUSED to test_cli
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
parent
e7a102f338
commit
aee1aed641
@ -37,3 +37,9 @@ class TestCephadmCLI(MgrTestCase):
|
||||
|
||||
out = self._orch_cmd('status', '--format', 'yaml')
|
||||
self.assertNotIn('!!python', out)
|
||||
|
||||
def test_pause(self):
|
||||
self._orch_cmd('pause')
|
||||
self.wait_for_health('CEPHADM_PAUSED', 30)
|
||||
self._orch_cmd('resume')
|
||||
self.wait_for_health_clear(30)
|
||||
|
@ -467,8 +467,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
|
||||
ret = self.event.wait(sleep_interval)
|
||||
self.event.clear()
|
||||
|
||||
def serve(self):
|
||||
# type: () -> None
|
||||
def serve(self) -> None:
|
||||
"""
|
||||
The main loop of cephadm.
|
||||
|
||||
A command handler will typically change the declarative state
|
||||
of cephadm. This loop will then attempt to apply this new state.
|
||||
"""
|
||||
self.log.debug("serve starting")
|
||||
while self.run:
|
||||
|
||||
@ -480,19 +485,9 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
|
||||
|
||||
self._check_for_strays()
|
||||
|
||||
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)
|
||||
self._update_paused_health()
|
||||
|
||||
if not self.paused:
|
||||
self.rm_util._remove_osds_bg()
|
||||
|
||||
self.migration.migrate()
|
||||
@ -520,6 +515,20 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
|
||||
self._serve_sleep()
|
||||
self.log.debug("serve exit")
|
||||
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user