Skip to content

Commit

Permalink
python3 compatible print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
valerytschopp committed Jan 30, 2019
1 parent 4c8b065 commit f77cd2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Here is a simple example:
# bucket operations
buckets = rgwadmin.get_buckets()
for bucket in buckets:
print bucket
print(bucket)
testuser1_buckets = testuser1.get_buckets()
for bucket in testuser1_buckets:
Expand Down
20 changes: 10 additions & 10 deletions examples/radosgw-admin-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,29 @@
debug=args.debug,
aws_signature=args.signature)

print "{:*^20}".format('Buckets')
print("{:*^20}".format('Buckets'))
buckets = rgwadmin.get_buckets()
print "{:>3} buckets".format(len(buckets))
print("{:>3} buckets".format(len(buckets)))
i = 1
total_size_kb = 0
total_num_object = 0
for bucket in buckets:
print "{:>3} bucket: {}".format(i, bucket)
print("{:>3} bucket: {}".format(i, bucket))
if bucket.usage:
print " usage: {}".format(bucket.usage)
print(" usage: {}".format(bucket.usage))
total_size_kb += bucket.usage.size_kb
total_num_object += bucket.usage.num_objects
i += 1
print "Total: {} objects, {} KB".format(total_num_object, total_size_kb)
print("Total: {} objects, {} KB".format(total_num_object, total_size_kb))

print "{:*^20}".format('Users')
print("{:*^20}".format('Users'))
# WARNING: get_users is very slow !!!
# one callout per user
users = rgwadmin.get_users()
print "{:>3} users".format(len(users))
print("{:>3} users".format(len(users)))
for user in users:
print "user:", user
print("user: {}".format(user))
for key in user.keys:
print " key:", key
print(" key: {}".format(key))
for cap in user.caps:
print " cap:", cap
print(" cap: {}".format(cap))

0 comments on commit f77cd2c

Please sign in to comment.