return entry['total']['successful_ops']
+def get_acl(key):
+ """
+ Helper function to get the xml acl from a key, ensuring that the xml
+ version tag is removed from the acl response
+ """
+ raw_acl = key.get_xml_acl()
+
+ def remove_version(string):
+ return string.split(
+ '<?xml version="1.0" encoding="UTF-8"?>'
+ )[-1]
+
+ def remove_newlines(string):
+ return string.strip('\n')
+
+ return remove_version(
+ remove_newlines(raw_acl)
+ )
+
+
def task(ctx, config):
"""
Test radosgw-admin functionality against a running rgw instance.
['policy', '--bucket', bucket.name, '--object', key.key],
check_status=True)
- acl = key.get_xml_acl()
+ acl = get_acl(key)
assert acl == out.strip('\n')
['policy', '--bucket', bucket.name, '--object', key.key],
check_status=True)
- acl = key.get_xml_acl()
+ acl = get_acl(key)
+
assert acl == out.strip('\n')
# TESTCASE 'rm-bucket', 'bucket', 'rm', 'bucket with objects', 'succeeds'