From: Joe Buck Date: Sat, 17 Aug 2013 17:14:37 +0000 (-0700) Subject: radosgw-admin: use dynamic ports for testing X-Git-Tag: 1.1.0~1956 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=549bac3edec419d7f48006d14ff49c47106eebfd;p=teuthology.git radosgw-admin: use dynamic ports for testing The rgw.py task was extended to dynamically assign port numbers to radosgateways. This patch extends the radosgw-admin task to use those ports rather than making out-dated assumptions of port numbering. Signed-off-by: Joe Buck --- diff --git a/teuthology/task/radosgw-admin.py b/teuthology/task/radosgw-admin.py index 8f7e97bf5..c1c9ecb5b 100644 --- a/teuthology/task/radosgw-admin.py +++ b/teuthology/task/radosgw-admin.py @@ -57,6 +57,10 @@ def task(ctx, config): if multi_region_run: client = rgw_utils.get_master_client(ctx, clients) + # once the client is chosen, pull the host name and assigned port out of + # the role_endpoints that were assigned by the rgw task + (remote_host, remote_port) = ctx.rgw.role_endpoints[client] + ## user1='foo' user2='fud' @@ -292,13 +296,11 @@ def task(ctx, config): rgw_utils.radosgw_agent_sync_all(ctx) # connect to rgw - (remote,) = ctx.cluster.only(client).remotes.iterkeys() - (remote_user, remote_host) = remote.name.split('@') connection = boto.s3.connection.S3Connection( aws_access_key_id=access_key, aws_secret_access_key=secret_key, is_secure=False, - port=7280, + port=remote_port, host=remote_host, calling_format=boto.s3.connection.OrdinaryCallingFormat(), ) diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index 47d589d61..8e8e0e265 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -1,3 +1,4 @@ +import argparse import contextlib import json import logging @@ -581,6 +582,8 @@ def task(ctx, config): del config['regions'] role_endpoints = assign_ports(ctx, config) + ctx.rgw = argparse.Namespace() + ctx.rgw.role_endpoints = role_endpoints with contextutil.nested( lambda: create_dirs(ctx=ctx, config=config),