daemon_type == 'nfs' or \
daemon_type == 'iscsi':
# get container image
- ret, image, err = self.check_mon_command({
- 'prefix': 'config get',
- 'who': utils.name_to_config_section(daemon_name),
- 'key': 'container_image',
- })
- image = image.strip()
+ image = str(self.get_foreign_ceph_option(
+ utils.name_to_config_section(daemon_name),
+ 'container_image'
+ )).strip()
elif daemon_type == 'prometheus':
image = self.container_image_prometheus
elif daemon_type == 'grafana':
public_network = None
if service_type == 'mon':
- ret, out, err = self.mgr.check_mon_command({
- 'prefix': 'config get',
- 'who': 'mon',
- 'key': 'public_network',
- })
+ out = str(self.mgr.get_foreign_ceph_option('mon', 'public_network'))
if '/' in out:
public_network = out.strip()
self.log.debug('mon public_network is %s' % public_network)
res.complete(0, outb, '')
+ def _ceph_get_foreign_option(self, entity, name):
+ who = entity.split('.')
+ whos = ['global'] + ['.'.join(who[:i+1]) for i in range(len(who))]
+ for attepmt in reversed(whos):
+ val = self.mock_store_get('config', f'{attepmt}/{name}', None)
+ if val is not None:
+ return val
+ return None
+
def assert_issued_mon_command(self, command):
assert command in self._mon_commands_sent, self._mon_commands_sent