-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hi ,
I figured out a little typo in the module 'ceph_add_users_buckets.py' when you create a bucket , it doesn't catch the right exception 'radosgw.exception.NoSuchBucket' it only catch the 'TypeError' Exception which cause the module to fail if we try to create a new bucket with the error 'radosgw.exception.NoSuchBucket: NoSuchBucket (404 Not Found)' .
Here below the simple fix suggested on the file ' ceph_add_users_buckets.py ' (just catch the NoSuchBucket Exception)==>
def create_buckets(rgw, buckets, result):
...
for bucket_info in buckets:
bucket = bucket_info['bucket']
user = bucket_info['user']
# check if bucket exists
try:
bucket_info = rgw.get_bucket(bucket_name=bucket)
except TypeError:
# it doesnt exist
bucket_info = None
** except radosgw.exception.NoSuchBucket:
bucket_info = None **
# if it exists add to failed list
if bucket_info:
failed_buckets.append(bucket)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels