]> 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 37929/head
authorcao.leilc <cao.leilc@inspur.com>
Tue, 3 Nov 2020 06:41:36 +0000 (14:41 +0800)
committercao.leilc <cao.leilc@inspur.com>
Tue, 3 Nov 2020 07:58:53 +0000 (15:58 +0800)
Fixes: https://tracker.ceph.com/issues/48073
Signed-off-by: caolei <halei15848934852@163.com>
src/rgw/rgw_bucket.cc

index 0ef697fd07d1e52b49165de775289a6b18481f62..574f52808c345af70037e258602caadc2035c85c 100644 (file)
@@ -1495,7 +1495,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;
   }