From: Cory Snyder Date: Mon, 25 Sep 2023 10:06:41 +0000 (+0000) Subject: rgw: fix output formatting of bucket index check admin api X-Git-Tag: v16.2.15~169^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53808%2Fhead;p=ceph.git rgw: fix output formatting of bucket index check admin api The bucket index check admin API was previously returning invalid JSON. Signed-off-by: Cory Snyder (cherry picked from commit 32fb6a1a68398a99324b2e64ebe3bcf3a9ccf02a) --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 05d69606d2ba..d104bf3c05da 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1670,6 +1670,8 @@ int RGWBucketAdminOp::check_index(rgw::sal::RGWRadosStore *store, RGWBucketAdmin Formatter *formatter = flusher.get_formatter(); flusher.start(0); + + formatter->open_object_section("bucket_check"); ret = bucket.check_bad_index_multipart(op_state, flusher, dpp); if (ret < 0) @@ -1686,6 +1688,7 @@ int RGWBucketAdminOp::check_index(rgw::sal::RGWRadosStore *store, RGWBucketAdmin return ret; dump_index_check(existing_stats, calculated_stats, formatter); + formatter->close_section(); flusher.flush(); return 0;