]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
radosgw-admin: use dynamic ports for testing
authorJoe Buck <jbbuck@gmail.com>
Sat, 17 Aug 2013 17:14:37 +0000 (10:14 -0700)
committerJoe Buck <jbbuck@gmail.com>
Wed, 21 Aug 2013 04:21:17 +0000 (21:21 -0700)
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 <jbbuck@gmail.com>
teuthology/task/radosgw-admin.py
teuthology/task/rgw.py

index 8f7e97bf5bb1312eeab09ba00ea27d2280a5d31d..c1c9ecb5b3d5f9a769a46257fbf73e7b9ed1b165 100644 (file)
@@ -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(),
         )
index 47d589d61e1c3cc25fe173f7e1259f096ac23cd9..8e8e0e2652350ec94b9f66b6236613147ba921a5 100644 (file)
@@ -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),