]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: aws sync module, fix target object naming
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 13 Oct 2017 23:47:38 +0000 (16:47 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:05:38 +0000 (08:05 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync_module_aws.cc

index 07631aa1f6f8eedda88d9a7c653dce2e64474a25..dd9cb8ae263a8cc5b461f9b6c246eefa8c468b65 100644 (file)
@@ -24,10 +24,8 @@ static string aws_bucket_name(const RGWBucketInfo& bucket_info, bool user_bucket
 
 static string aws_object_name(const RGWBucketInfo& bucket_info, const rgw_obj_key&key, bool user_buckets=false){
   string bucket_name = aws_bucket_name(bucket_info, user_buckets);
-  string object_name = bucket_name+"/";
-  if (!user_buckets){
-    object_name += bucket_info.owner.tenant + bucket_info.owner.id + "/";
-  }
+  string object_name;
+  object_name += bucket_info.owner.to_str() + "/";
   object_name += bucket_info.bucket.name + "/" + key.name;
   return object_name;
 }
@@ -80,7 +78,7 @@ public:
       }
     }
 
-    ldout(sync_env->cct, 20) << __func << ":" << " headers=" << headers << " extra_data.length()=" << extra_data.length() << dendl;
+    ldout(sync_env->cct, 20) << __func__ << ":" << " headers=" << headers << " extra_data.length()=" << extra_data.length() << dendl;
 
     return 0;
 
@@ -262,7 +260,7 @@ public:
       ldout(sync_env->cct, 0) << ": remove remote obj: z=" << sync_env->source_zone
                               << " b=" << bucket_info.bucket << " k=" << key << " mtime=" << mtime << dendl;
       yield {
-        string path = aws_object_name(bucket_info, key);
+        string path = aws_bucket_name(bucket_info) + "/" + aws_object_name(bucket_info, key);
         ldout(sync_env->cct, 0) << "AWS: removing aws object at" << path << dendl;
         call(new RGWDeleteRESTResourceCR(sync_env->cct, conf.conn.get(),
                                          sync_env->http_manager,