]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw : modify error message to NoSuchBucket when bucket doesn't exist in bucket info API 38588/head
authorcao.leilc <cao.leilc@inspur.com>
Tue, 3 Nov 2020 06:41:36 +0000 (14:41 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 15 Jan 2021 10:45:41 +0000 (11:45 +0100)
Fixes: https://tracker.ceph.com/issues/48073
Signed-off-by: caolei <halei15848934852@163.com>
(cherry picked from commit bc5ef5c9cf0ea89fc028332c39766eb8e7e1bd0b)

Conflicts:
src/rgw/rgw_bucket.cc
- bucket.init() call has an additional argument in master

src/rgw/rgw_bucket.cc

index 830efa60e58bee8bdc49bd7b5f8434f315c869c5..7ea22e443904c120cd1ca75c6da4d1b49e555a81 100644 (file)
@@ -1649,7 +1649,9 @@ int RGWBucketAdminOp::info(RGWRados *store, RGWBucketAdminOpState& op_state,
   const std::string& bucket_name = op_state.get_bucket_name();
   if (!bucket_name.empty()) {
     ret = bucket.init(store, op_state);
-    if (ret < 0)
+    if (-ENOENT == ret)
+      return -ERR_NO_SUCH_BUCKET;
+    else if (ret < 0)
       return ret;
   }