From 6c5a7af1b4805a23326b71975bd6f9be48cf911c Mon Sep 17 00:00:00 2001 From: Joe Buck Date: Fri, 23 Aug 2013 19:16:29 -0700 Subject: [PATCH] move multi_region_enabled() into util class Moving a helper function into a more general location so that it can be used by other classes. Signed-off-by: Joe Buck Reviewed-by: Josh Durgin --- teuthology/task/radosgw-admin.py | 7 +------ teuthology/task_util/rgw.py | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/teuthology/task/radosgw-admin.py b/teuthology/task/radosgw-admin.py index 3f9daeba88..fb29b546be 100644 --- a/teuthology/task/radosgw-admin.py +++ b/teuthology/task/radosgw-admin.py @@ -31,11 +31,6 @@ def successful_ops(out): entry = summary[0] return entry['total']['successful_ops'] -# simple test to indicate if multi-region testing should occur -def multi_region_enabled(ctx): - # this is populated by the radosgw-agent task, seems reasonable to - # use that as an indicator that we're testing multi-region sync - return 'radosgw_agent' in ctx def task(ctx, config): """ @@ -52,7 +47,7 @@ def task(ctx, config): config = dict.fromkeys(config) clients = config.keys() - multi_region_run = multi_region_enabled(ctx) + multi_region_run = rgw_utils.multi_region_enabled(ctx) client = clients[0]; # default choice, multi-region code may overwrite this if multi_region_run: diff --git a/teuthology/task_util/rgw.py b/teuthology/task_util/rgw.py index 91458e5cbb..058292596e 100644 --- a/teuthology/task_util/rgw.py +++ b/teuthology/task_util/rgw.py @@ -9,6 +9,12 @@ from teuthology import misc as teuthology log = logging.getLogger(__name__) +# simple test to indicate if multi-region testing should occur +def multi_region_enabled(ctx): + # this is populated by the radosgw-agent task, seems reasonable to + # use that as an indicator that we're testing multi-region sync + return 'radosgw_agent' in ctx + def rgwadmin(ctx, client, cmd, stdin=StringIO(), check_status=False): log.info('rgwadmin: {client} : {cmd}'.format(client=client,cmd=cmd)) testdir = teuthology.get_testdir(ctx) -- 2.39.5