self._serve_sleep()
self.log.debug("serve exit")
+ def set_container_image(self, entity: str, image):
+ self.check_mon_command({
+ 'prefix': 'config set',
+ 'name': 'container_image',
+ 'value': image,
+ 'who': entity,
+ })
+
def _update_paused_health(self):
if self.paused:
self.health_checks['CEPHADM_PAUSED'] = {
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
def test_upgrade_run(cephadm_module: CephadmOrchestrator):
with with_host(cephadm_module, 'test'):
- cephadm_module.check_mon_command({
- 'prefix': 'config set',
- 'name': 'container_image',
- 'value': 'from_image',
- 'who': 'global',
- })
+ cephadm_module.set_container_image('global', 'from_image')
with with_service(cephadm_module, ServiceSpec('mgr'), CephadmOrchestrator.apply_mgr, 'test'):
assert wait(cephadm_module, cephadm_module.upgrade_start(
'to_image', None)) == 'Initiating upgrade to to_image'
if image_settings.get(daemon_type) != target_name:
logger.info('Upgrade: Setting container_image for all %s...' %
daemon_type)
- ret, out, err = self.mgr.check_mon_command({
- 'prefix': 'config set',
- 'name': 'container_image',
- 'value': target_name,
- 'who': name_to_config_section(daemon_type),
- })
+ self.mgr.set_container_image(name_to_config_section(daemon_type), target_name)
to_clean = []
for section in image_settings.keys():
if section.startswith(name_to_config_section(daemon_type) + '.'):
# clean up
logger.info('Upgrade: Finalizing container_image settings')
- ret, out, err = self.mgr.check_mon_command({
- 'prefix': 'config set',
- 'name': 'container_image',
- 'value': target_name,
- 'who': 'global',
- })
+ self.mgr.set_container_image('global', target_name)
+
for daemon_type in CEPH_UPGRADE_ORDER:
ret, image, err = self.mgr.check_mon_command({
'prefix': 'config rm',