From 6ca0c47c88fd460b42a2fafa67010ec0bacf2d56 Mon Sep 17 00:00:00 2001 From: Cory Snyder Date: Mon, 25 Sep 2023 10:06:41 +0000 Subject: [PATCH] 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) --- src/rgw/rgw_bucket.cc | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.3