From: Josh Durgin Date: Wed, 6 Apr 2016 05:40:17 +0000 (-0700) Subject: tasks: update ctx.ceph.conf readers to use per-cluster conf X-Git-Tag: v11.1.1~58^2^2~212^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a9872182d362ded03a3f23679a389e686806be5d;p=ceph.git tasks: update ctx.ceph.conf readers to use per-cluster conf Just use the default cluster name for now, since these tasks aren't used for multi-cluster tests yet. Signed-off-by: Josh Durgin --- diff --git a/tasks/cephfs/filesystem.py b/tasks/cephfs/filesystem.py index f9ad1488aa9b..1b3b71e017d5 100644 --- a/tasks/cephfs/filesystem.py +++ b/tasks/cephfs/filesystem.py @@ -168,14 +168,14 @@ class MDSCluster(object): 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): diff --git a/tasks/mon_thrash.py b/tasks/mon_thrash.py index b45aaa999780..0754bcdd4e97 100644 --- a/tasks/mon_thrash.py +++ b/tasks/mon_thrash.py @@ -156,7 +156,7 @@ class MonitorThrasher: 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) diff --git a/tasks/qemu.py b/tasks/qemu.py index a40a43195275..70d95e45362e 100644 --- a/tasks/qemu.py +++ b/tasks/qemu.py @@ -311,9 +311,9 @@ def run_qemu(ctx, config): ] 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' diff --git a/tasks/rgw.py b/tasks/rgw.py index b874642661c7..a1a25f9f84e7 100644 --- a/tasks/rgw.py +++ b/tasks/rgw.py @@ -452,9 +452,9 @@ def extract_zone_info(ctx, client, client_config): :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, diff --git a/tasks/s3tests.py b/tasks/s3tests.py index 3fe391622f1c..20f328b17994 100644 --- a/tasks/s3tests.py +++ b/tasks/s3tests.py @@ -29,7 +29,7 @@ def extract_sync_client_data(ctx, client_name): """ 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: diff --git a/tasks/util/rgw.py b/tasks/util/rgw.py index f7d6ba58a9be..fe03311c9aab 100644 --- a/tasks/util/rgw.py +++ b/tasks/util/rgw.py @@ -119,21 +119,21 @@ def get_zone_system_keys(ctx, 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):