From 96ed9c87c0ca336d13b3da81bc26484426e24f28 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 7 Apr 2020 00:51:12 +0800 Subject: [PATCH] qa/tasks/radosgw_admin.py: coerce key.name and key.acl to str if `key.name` is not set, boto fills it with md5, in that case, it comes from `base64.b64encode()`. so we need to make sure it's str before passing it to shell. the same applies to `key.get_xml_acl()`, as its return value comes directly from something like ``` response = self.connection.make_request('GET', self.name, key_name, query_args=query_args, headers=headers) body = response.read() # ... return body ``` Signed-off-by: Kefu Chai --- qa/tasks/radosgw_admin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qa/tasks/radosgw_admin.py b/qa/tasks/radosgw_admin.py index 2cc85865fbc99..092d83fd8e262 100644 --- a/qa/tasks/radosgw_admin.py +++ b/qa/tasks/radosgw_admin.py @@ -245,7 +245,7 @@ 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() + raw_acl = six.ensure_str(key.get_xml_acl()) def remove_version(string): return string.split( @@ -800,7 +800,7 @@ def task(ctx, config): rl.log_and_clear("put_acls", bucket_name, user1) (err, out) = rgwadmin(ctx, client, - ['policy', '--bucket', bucket.name, '--object', key.key], + ['policy', '--bucket', bucket.name, '--object', six.ensure_str(key.key)], check_status=True, format='xml') acl = get_acl(key) @@ -813,7 +813,7 @@ def task(ctx, config): rl.log_and_clear("put_acls", bucket_name, user1) (err, out) = rgwadmin(ctx, client, - ['policy', '--bucket', bucket.name, '--object', key.key], + ['policy', '--bucket', bucket.name, '--object', six.ensure_str(key.key)], check_status=True, format='xml') acl = get_acl(key) -- 2.39.5