]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: radosgw_admin_rest task uses util.rgw.rgwadmin()
authorCasey Bodley <cbodley@redhat.com>
Fri, 20 Jul 2018 16:33:54 +0000 (12:33 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 Jul 2018 18:29:47 +0000 (14:29 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/tasks/radosgw_admin_rest.py

index 99a742f13b9e18efc2b9bf7d0e38c272227ba925..3df8be3c27239b8588cdb15a182c22753ee2a84c 100644 (file)
@@ -20,49 +20,10 @@ import time
 
 from boto.connection import AWSAuthConnection
 from teuthology import misc as teuthology
-from util.rgw import get_user_summary, get_user_successful_ops
+from util.rgw import get_user_summary, get_user_successful_ops, rgwadmin
 
 log = logging.getLogger(__name__)
 
-def rgwadmin(ctx, client, cmd):
-    """
-    Perform rgw admin command
-
-    :param client: client
-    :param cmd: command to execute.
-    :return: command exit status, json result.
-    """
-    log.info('radosgw-admin: %s' % cmd)
-    testdir = teuthology.get_testdir(ctx)
-    pre = [
-        'adjust-ulimits',
-        'ceph-coverage',
-        '{tdir}/archive/coverage'.format(tdir=testdir),
-        'radosgw-admin',
-        '--log-to-stderr',
-        '--format', 'json',
-        ]
-    pre.extend(cmd)
-    (remote,) = ctx.cluster.only(client).remotes.iterkeys()
-    proc = remote.run(
-        args=pre,
-        check_status=False,
-        stdout=StringIO(),
-        stderr=StringIO(),
-        )
-    r = proc.exitstatus
-    out = proc.stdout.getvalue()
-    j = None
-    if not r and out != '':
-        try:
-            j = json.loads(out)
-            log.info(' json result: %s' % j)
-        except ValueError:
-            j = out
-            log.info(' raw result: %s' % j)
-    return (r, j)
-
-
 def rgwadmin_rest(connection, cmd, params=None, headers=None, raw=False):
     """
     perform a rest command