From: Yehuda Sadeh Date: Fri, 30 May 2014 20:31:38 +0000 (-0700) Subject: radosgw-admin: adjust bucket link interface X-Git-Tag: 1.1.0~1423 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3968f6f744a1dd9722740b5bae74c727c8bc2a7c;p=teuthology.git radosgw-admin: adjust bucket link interface Signed-off-by: Yehuda Sadeh --- diff --git a/teuthology/task/radosgw_admin.py b/teuthology/task/radosgw_admin.py index 6936b798fa..c57b55203a 100644 --- a/teuthology/task/radosgw_admin.py +++ b/teuthology/task/radosgw_admin.py @@ -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],