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: v14.2.17~81^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=071808ad766cd624c6fc21f06cc283d5b150f0e2;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) Conflicts: src/rgw/rgw_bucket.cc - bucket.init() call has an additional argument in master --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 830efa60e58b..7ea22e443904 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -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; }