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

src/rgw/rgw_bucket.cc

index 7c6e9e252b914be36272936902ce790a2358959e..054de08e172a8e19afcc113cb8057886870218c4 100644 (file)
@@ -1597,7 +1597,9 @@ int RGWBucketAdminOp::info(rgw::sal::RGWRadosStore *store,
   const std::string& bucket_name = op_state.get_bucket_name();
   if (!bucket_name.empty()) {
     ret = bucket.init(store, op_state, null_yield);
-    if (ret < 0)
+    if (-ENOENT == ret)
+      return -ERR_NO_SUCH_BUCKET;
+    else if (ret < 0)
       return ret;
   }