]> git-server-git.apps.pok.os.sepia.ceph.com Git - radosgw-agent.git/commitdiff
client: fix unicode handling
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 25 Apr 2014 23:52:16 +0000 (16:52 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 25 Apr 2014 23:54:00 +0000 (16:54 -0700)
Use unicode format strings, and don't url-encode the object copy path
before passing it to requests, which will url-encode it for us.

Partially-fixes: #8202
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
radosgw_agent/client.py

index 2b8f027a0a1b72fcb8553af341d00f884cfe29e0..bd39d5b69017c29b63122c7c35dc19bff338f1e2 100644 (file)
@@ -182,7 +182,7 @@ def get_op_state(connection, client_id, op_id, bucket, obj):
     return request(connection, 'get', 'admin/opstate',
                    params={
                        'op-id': op_id,
-                       'object': '{0}/{1}'.format(bucket, obj),
+                       'object': u'{0}/{1}'.format(bucket, obj),
                        'client-id': client_id,
                       }
                    )
@@ -191,7 +191,7 @@ def remove_op_state(connection, client_id, op_id, bucket, obj):
     return request(connection, 'delete', 'admin/opstate',
                    params={
                        'op-id': op_id,
-                       'object': '{0}/{1}'.format(bucket, obj),
+                       'object': u'{0}/{1}'.format(bucket, obj),
                        'client-id': client_id,
                       },
                    expect_json=False,
@@ -213,9 +213,9 @@ def delete_object(connection, bucket_name, object_name):
 
 def sync_object_intra_region(connection, bucket_name, object_name, src_zone,
                              client_id, op_id):
-    path = '{bucket}/{object}'.format(
-        bucket=url_safe(bucket_name),
-        object=url_safe(object_name),
+    path = u'{bucket}/{object}'.format(
+        bucket=bucket_name,
+        object=object_name,
         )
     return request(connection, 'put', path,
                    params={