in files/default/rgw_s3_api.py [0:0]
def bucket_list(bucket, verbose=False):
if not bucket:
if verbose:
print('Bucket handle not valid.')
return None
try:
for i in bucket.list():
obj_name = i.key.split("/")[-1] # i.name # i.key.split("/")[-1]
size = i.size # i.get_contents_to_filename(obj_name)
print('%s: %d' % (obj_name, size))
except BaseException, e:
print(e.message)
return None # This is only a debug test function...