]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust error for bucket removal on secondary region
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 18 Jul 2013 17:48:39 +0000 (10:48 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 19 Jul 2013 20:21:49 +0000 (13:21 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_op.cc

index 05c31d61689dcc565a516dce25ae2ad37682a29f..f0c57e78cabe71e0715aec5fe11419ccf617c36f 100644 (file)
@@ -1074,8 +1074,13 @@ void RGWDeleteBucket::execute()
     bufferlist in_data;
     JSONParser jp;
     ret = forward_request_to_master(s, store, in_data, &jp);
-    if (ret < 0)
+    if (ret < 0) {
+      if (ret == -ENOENT) { /* adjust error,
+                               we want to return with NoSuchBucket and not NoSuchKey */
+        ret = -ERR_NO_SUCH_BUCKET;
+      }
       return;
+    }
 
     JSONDecoder::decode_json("object_ver", objv_tracker.read_version, &jp);
   }