return self.json_asok(['config', 'get', key], service_type, service_id)[key]
def set_ceph_conf(self, subsys, key, value):
- if subsys not in self._ctx.ceph.conf:
- self._ctx.ceph.conf[subsys] = {}
- self._ctx.ceph.conf[subsys][key] = value
+ if subsys not in self._ctx.ceph['ceph'].conf:
+ self._ctx.ceph['ceph'].conf[subsys] = {}
+ self._ctx.ceph['ceph'].conf[subsys][key] = value
write_conf(self._ctx) # XXX because we don't have the ceph task's config object, if they
# used a different config path this won't work.
def clear_ceph_conf(self, subsys, key):
- del self._ctx.ceph.conf[subsys][key]
+ del self._ctx.ceph['ceph'].conf[subsys][key]
write_conf(self._ctx)
def json_asok(self, command, service_type, service_id):
Thrash the monitor specified.
:param mon: monitor to thrash
"""
- addr = self.ctx.ceph.conf['mon.%s' % mon]['mon addr']
+ addr = self.ctx.ceph['ceph'].conf['mon.%s' % mon]['mon addr']
self.log('thrashing mon.{id}@{addr} store'.format(id=mon, addr=addr))
out = self.manager.raw_cluster_cmd('-m', addr, 'sync', 'force')
j = json.loads(out)
]
cachemode = 'none'
- ceph_config = ctx.ceph.conf.get('global', {})
- ceph_config.update(ctx.ceph.conf.get('client', {}))
- ceph_config.update(ctx.ceph.conf.get(client, {}))
+ ceph_config = ctx.ceph['ceph'].conf.get('global', {})
+ ceph_config.update(ctx.ceph['ceph'].conf.get('client', {}))
+ ceph_config.update(ctx.ceph['ceph'].conf.get(client, {}))
if ceph_config.get('rbd cache'):
if ceph_config.get('rbd cache max dirty', 1) > 0:
cachemode = 'writeback'
:param client_config: dictionary of client configuration information
:returns: zone extracted from client and client_config information
"""
- ceph_config = ctx.ceph.conf.get('global', {})
- ceph_config.update(ctx.ceph.conf.get('client', {}))
- ceph_config.update(ctx.ceph.conf.get(client, {}))
+ ceph_config = ctx.ceph['ceph'].conf.get('global', {})
+ ceph_config.update(ctx.ceph['ceph'].conf.get('client', {}))
+ ceph_config.update(ctx.ceph['ceph'].conf.get(client, {}))
for key in ['rgw zone', 'rgw region', 'rgw zone root pool']:
assert key in ceph_config, \
'ceph conf must contain {key} for {client}'.format(key=key,
"""
return_region_name = None
return_dict = None
- client = ctx.ceph.conf.get(client_name, None)
+ client = ctx.ceph['ceph'].conf.get(client_name, None)
if client:
current_client_zone = client.get('rgw zone', None)
if current_client_zone:
return system_key['access_key'], system_key['secret_key']
def zone_for_client(ctx, client):
- ceph_config = ctx.ceph.conf.get('global', {})
- ceph_config.update(ctx.ceph.conf.get('client', {}))
- ceph_config.update(ctx.ceph.conf.get(client, {}))
+ ceph_config = ctx.ceph['ceph'].conf.get('global', {})
+ ceph_config.update(ctx.ceph['ceph'].conf.get('client', {}))
+ ceph_config.update(ctx.ceph['ceph'].conf.get(client, {}))
return ceph_config.get('rgw zone')
def region_for_client(ctx, client):
- ceph_config = ctx.ceph.conf.get('global', {})
- ceph_config.update(ctx.ceph.conf.get('client', {}))
- ceph_config.update(ctx.ceph.conf.get(client, {}))
+ ceph_config = ctx.ceph['ceph'].conf.get('global', {})
+ ceph_config.update(ctx.ceph['ceph'].conf.get('client', {}))
+ ceph_config.update(ctx.ceph['ceph'].conf.get(client, {}))
return ceph_config.get('rgw region')
def radosgw_data_log_window(ctx, client):
- ceph_config = ctx.ceph.conf.get('global', {})
- ceph_config.update(ctx.ceph.conf.get('client', {}))
- ceph_config.update(ctx.ceph.conf.get(client, {}))
+ ceph_config = ctx.ceph['ceph'].conf.get('global', {})
+ ceph_config.update(ctx.ceph['ceph'].conf.get('client', {}))
+ ceph_config.update(ctx.ceph['ceph'].conf.get(client, {}))
return ceph_config.get('rgw data log window', 30)
def radosgw_agent_sync_data(ctx, agent_host, agent_port, full=False):