]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
move multi_region_enabled() into util class
authorJoe Buck <jbbuck@gmail.com>
Sat, 24 Aug 2013 02:16:29 +0000 (19:16 -0700)
committerJoe Buck <jbbuck@gmail.com>
Wed, 28 Aug 2013 15:59:15 +0000 (08:59 -0700)
Moving a helper function into a more general
location so that it can be used by other
classes.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
teuthology/task/radosgw-admin.py
teuthology/task_util/rgw.py

index 3f9daeba88faf75cac3ab9b2138b043d7201533c..fb29b546be95c28c146d676215c7e5251f0357aa 100644 (file)
@@ -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:
index 91458e5cbb13d2912e1f3aa0accb5ae194d9fb3d..058292596e2e4fce3b4300de3224b2c203c5f044 100644 (file)
@@ -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)