From: Josh Durgin Date: Fri, 2 Aug 2013 01:56:08 +0000 (-0700) Subject: radosgw-agent: move zone extraction to helper X-Git-Tag: 1.1.0~2000 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ec9c1b4b869ab9a9cc9006ffedfa2e54eb6b4b9;p=teuthology.git radosgw-agent: move zone extraction to helper This will be useful for other tasks. Signed-off-by: Josh Durgin --- diff --git a/teuthology/task/radosgw-agent.py b/teuthology/task/radosgw-agent.py index cb9bf7e3d..401c3c2e3 100644 --- a/teuthology/task/radosgw-agent.py +++ b/teuthology/task/radosgw-agent.py @@ -1,5 +1,4 @@ import contextlib -from copy import deepcopy import logging from ..orchestra import run @@ -15,15 +14,8 @@ def run_radosgw_agent(ctx, client, config): src_client = config['src'] dest_client = config['dest'] - ceph_config = ctx.ceph.conf.get('global', {}) - ceph_config.update(ctx.ceph.conf.get('client', {})) - src_ceph_config = deepcopy(ceph_config) - src_ceph_config.update(ctx.ceph.conf.get(src_client, {})) - dest_ceph_config = deepcopy(ceph_config) - dest_ceph_config.update(ctx.ceph.conf.get(dest_client, {})) - - src_zone = src_ceph_config['rgw zone'] - dest_zone = dest_ceph_config['rgw zone'] + src_zone = rgw_utils.zone_for_client(ctx, src_client) + dest_zone = rgw_utils.zone_for_client(ctx, dest_client) log.info("source is %s", src_zone) log.info("dest is %s", dest_zone) diff --git a/teuthology/task_util/rgw.py b/teuthology/task_util/rgw.py index 8a0c87e54..c737e2979 100644 --- a/teuthology/task_util/rgw.py +++ b/teuthology/task_util/rgw.py @@ -59,3 +59,9 @@ def get_zone_system_keys(ctx, client, zone): 'zone', 'get', '--rgw-zone', zone]) system_key = zone_info['system_key'] 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, {})) + return ceph_config.get('rgw zone')