From 975f34f2f6bf650c3a7df131cbe2567e1cebaac5 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 20 Jul 2018 12:34:39 -0400 Subject: [PATCH] qa/rgw: radosgw_admin_rest task uses rgw.role_endpoints for connections Signed-off-by: Casey Bodley --- qa/tasks/radosgw_admin_rest.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/qa/tasks/radosgw_admin_rest.py b/qa/tasks/radosgw_admin_rest.py index 3df8be3c272..401e0002254 100644 --- a/qa/tasks/radosgw_admin_rest.py +++ b/qa/tasks/radosgw_admin_rest.py @@ -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(), ) -- 2.39.5