]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: listing non existent bucket returns NoSuchBucket
authorYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 13 Apr 2011 15:45:43 +0000 (08:45 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 13 Apr 2011 15:45:43 +0000 (08:45 -0700)
src/rgw/rgw_common.h
src/rgw/rgw_op.cc
src/rgw/rgw_rest.cc

index de03ace16ad9acace654a816b69f57ac323e65b3..711273226bd9576dd490bb29e1f90d295942b115 100644 (file)
@@ -59,6 +59,10 @@ using ceph::crypto::MD5;
 } while (0)
 
 
+#define INVALID_BUCKET_NAME 2000
+#define INVALID_OBJECT_NAME 2001
+#define NO_SUCH_BUCKET      2002
+
 typedef void *RGWAccessHandle;
 
 /** Store error returns for output at a different point in the program */
index e9001533b7bdfb4212cddfca4580994ea8799430..82b980397e9c189099b9b9fa493595e8720211c4 100644 (file)
@@ -122,6 +122,8 @@ int read_acls(struct req_state *s, RGWAccessControlPolicy *policy, string& bucke
       ret = -EACCES;
     else
       ret = -ENOENT;
+  } else if (ret == -ENOENT) {
+      ret = -NO_SUCH_BUCKET;
   }
 
   return ret;
index 679f33462dca0eabf9ee50234ed7f493dc23f759..1db8804156efb4183cc5d2375bd3532308e09109 100644 (file)
@@ -34,9 +34,6 @@ struct errno_http {
   const char *default_code;
 };
 
-#define INVALID_BUCKET_NAME 2000
-#define INVALID_OBJECT_NAME 2001
-
 const static struct errno_http hterrs[] = {
     { 0, "200", "" },
     { 201, "201", "Created" },
@@ -48,6 +45,7 @@ const static struct errno_http hterrs[] = {
     { EACCES, "403", "AccessDenied" },
     { EPERM, "403", "AccessDenied" },
     { ENOENT, "404", "NoSuchKey" },
+    { NO_SUCH_BUCKET, "404", "NoSuchBucket" },
     { ETIMEDOUT, "408", "RequestTimeout" },
     { EEXIST, "409", "BucketAlreadyExists" },
     { ENOTEMPTY, "409", "BucketNotEmpty" },