]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix output formatting of bucket index check admin api 53808/head
authorCory Snyder <csnyder@1111systems.com>
Mon, 25 Sep 2023 10:06:41 +0000 (10:06 +0000)
committerCory Snyder <csnyder@1111systems.com>
Wed, 4 Oct 2023 08:55:21 +0000 (08:55 +0000)
The bucket index check admin API was previously returning invalid
JSON.

Signed-off-by: Cory Snyder <csnyder@1111systems.com>
(cherry picked from commit 32fb6a1a68398a99324b2e64ebe3bcf3a9ccf02a)

src/rgw/rgw_bucket.cc

index 05d69606d2ba58a429c95a8e93d1077d1525571f..d104bf3c05dad231cc4859d845d3799b8b310d6c 100644 (file)
@@ -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;