From: cao.leilc Date: Tue, 3 Nov 2020 06:41:36 +0000 (+0800) Subject: rgw : modify error message to NoSuchBucket when bucket doesn't exist in bucket info API X-Git-Tag: v15.2.9~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=77eb17c312020b6060edc012296552fb3eee0829;p=ceph.git rgw : modify error message to NoSuchBucket when bucket doesn't exist in bucket info API Fixes: https://tracker.ceph.com/issues/48073 Signed-off-by: caolei (cherry picked from commit bc5ef5c9cf0ea89fc028332c39766eb8e7e1bd0b) --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 7c6e9e252b91..054de08e172a 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -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; }