From: Casey Bodley Date: Mon, 1 Jul 2019 16:07:16 +0000 (-0400) Subject: qa/rgw: swift task looks for rgw_server endpoint X-Git-Tag: v14.2.2~10^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=84763779a966ceac7eb36a59607ec349edd8a764;p=ceph.git qa/rgw: swift task looks for rgw_server endpoint Signed-off-by: Casey Bodley (cherry picked from commit 5e667c4f73b1f064cc324bcaff9fe35ca9a4abc6) --- diff --git a/qa/tasks/swift.py b/qa/tasks/swift.py index c37eb88385c9e..491efb95b9fa2 100644 --- a/qa/tasks/swift.py +++ b/qa/tasks/swift.py @@ -127,19 +127,6 @@ def configure(ctx, config): log.info('client={c}'.format(c=client)) log.info('config={c}'.format(c=config)) testswift_conf = config['testswift_conf'][client] - if properties is not None and 'rgw_server' in properties: - host = None - for target, roles in zip(ctx.config['targets'].iterkeys(), ctx.config['roles']): - log.info('roles: ' + str(roles)) - log.info('target: ' + str(target)) - if properties['rgw_server'] in roles: - _, host = split_user(target) - assert host is not None, "Invalid client specified as the rgw_server" - testswift_conf['func_test']['auth_host'] = host - else: - testswift_conf['func_test']['auth_host'] = 'localhost' - - log.info(client) (remote,) = ctx.cluster.only(client).remotes.keys() remote.run( args=[ @@ -235,10 +222,7 @@ def task(ctx, config): testswift_conf = {} clients = [] - for client in config.keys(): - endpoint = ctx.rgw.role_endpoints.get(client) - assert endpoint, 'swift: no rgw endpoint for {}'.format(client) - + for client, client_config in config.iteritems(): # http://tracker.ceph.com/issues/40304 can't bootstrap on rhel 7.6+ (remote,) = ctx.cluster.only(client).remotes.keys() if remote.os.name == 'rhel' and LooseVersion(remote.os.version) >= LooseVersion('7.6'): @@ -247,12 +231,17 @@ def task(ctx, config): clients.append(client) + server = client_config.get('rgw_server', client) + endpoint = ctx.rgw.role_endpoints.get(server) + assert endpoint, 'swift: no rgw endpoint for {}'.format(server) + testswift_conf[client] = ConfigObj( indent_type='', infile={ 'func_test': { - 'auth_port' : endpoint.port, + 'auth_host' : endpoint.hostname, + 'auth_port' : endpoint.port, 'auth_ssl' : 'yes' if endpoint.cert else 'no', 'auth_prefix' : '/auth/', },