]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: radosgw_admin_rest task uses rgw.role_endpoints for connections
authorCasey Bodley <cbodley@redhat.com>
Fri, 20 Jul 2018 16:34:39 +0000 (12:34 -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 3df8be3c27239b8588cdb15a182c22753ee2a84c..401e0002254ba3f95496733cbb8ae44fe1215b69 100644 (file)
@@ -168,14 +168,16 @@ def task(ctx, config):
     logging.error(err)
     assert not err
 
-    (remote,) = ctx.cluster.only(client).remotes.iterkeys()
-    remote_host = remote.name.split('@')[1]
+    assert hasattr(ctx, 'rgw'), 'radosgw-admin-rest must run after the rgw task'
+    endpoint = ctx.rgw.role_endpoints.get(client)
+    assert endpoint, 'no rgw endpoint for {}'.format(client)
+
     admin_conn = boto.s3.connection.S3Connection(
         aws_access_key_id=admin_access_key,
         aws_secret_access_key=admin_secret_key,
-        is_secure=False,
-        port=7280,
-        host=remote_host,
+        is_secure=True if endpoint.cert else False,
+        port=endpoint.port,
+        host=endpoint.hostname,
         calling_format=boto.s3.connection.OrdinaryCallingFormat(),
         )
 
@@ -339,9 +341,9 @@ def task(ctx, config):
     connection = boto.s3.connection.S3Connection(
         aws_access_key_id=access_key,
         aws_secret_access_key=secret_key,
-        is_secure=False,
-        port=7280,
-        host=remote_host,
+        is_secure=True if endpoint.cert else False,
+        port=endpoint.port,
+        host=endpoint.hostname,
         calling_format=boto.s3.connection.OrdinaryCallingFormat(),
         )