From: cao.leilc Date: Mon, 19 Dec 2022 02:31:05 +0000 (+0800) Subject: rgw: fix result when user's topics is null X-Git-Tag: v18.1.0~553^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3cd6f03b5857623220830ab983a2504630caafea;p=ceph-ci.git rgw: fix result when user's topics is null Fixes: https://tracker.ceph.com/issues/53370 Signed-off-by: caolei --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index f18ce8cfbfb..dc9eeec9505 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -10430,7 +10430,7 @@ next: auto b = ps.get_bucket(bucket->get_key()); ret = b->get_topics(&result); - if (ret < 0) { + if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl; return -ret; } @@ -10438,7 +10438,7 @@ next: } else { rgw_pubsub_topics result; int ret = ps.get_topics(&result); - if (ret < 0) { + if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl; return -ret; }