]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
radosgw-admin: adjust bucket link interface
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 30 May 2014 20:31:38 +0000 (13:31 -0700)
committerZack Cerza <zack@cerza.org>
Mon, 2 Jun 2014 14:23:27 +0000 (09:23 -0500)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
teuthology/task/radosgw_admin.py

index 6936b798fa9d8cdda315e0a1c3d470284cc8bf82..c57b55203a8eac3938e901931070fbd15aaa1203 100644 (file)
@@ -699,7 +699,16 @@ def task(ctx, config):
     key.delete()
 
     # link the bucket to another user
-    (err, out) = rgwadmin(ctx, client, ['bucket', 'link', '--uid', user2, '--bucket', bucket_name],
+    (err, out) = rgwadmin(ctx, client, ['metadata', 'get', 'bucket:{n}'.format(n=bucket_name)],
+        check_status=True)
+
+    bucket_data = out['data']
+    assert bucket_data['bucket']['name'] == bucket_name
+
+    bucket_id = bucket_data['bucket']['bucket_id']
+
+    # link the bucket to another user
+    (err, out) = rgwadmin(ctx, client, ['bucket', 'link', '--uid', user2, '--bucket', bucket_name, '--bucket-id', bucket_id],
         check_status=True)
 
     # try to remove user, should fail (has a linked bucket)
@@ -712,7 +721,7 @@ def task(ctx, config):
 
     # relink the bucket to the first user and delete the second user
     (err, out) = rgwadmin(ctx, client,
-        ['bucket', 'link', '--uid', user1, '--bucket', bucket_name],
+        ['bucket', 'link', '--uid', user1, '--bucket', bucket_name, '--bucket-id', bucket_id],
         check_status=True)
 
     (err, out) = rgwadmin(ctx, client, ['user', 'rm', '--uid', user2],