]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix output formatting of bucket index check admin api 53821/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 14:58:21 +0000 (14:58 +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)

Conflicts:
src/rgw/driver/rados/rgw_bucket.cc

Cherry-pick notes:
- Conflicts due to rgw_bucket.cc moved to driver/rados directory on main

src/rgw/rgw_bucket.cc

index 1c582c12c3e9f936a9544a42850acf18afd4cab5..f3dbf2a0a46f6e1c7c3c663b4a342166a18bbe2f 100644 (file)
@@ -1423,6 +1423,8 @@ int RGWBucketAdminOp::check_index(rgw::sal::Store* store, RGWBucketAdminOpState&
 
   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)
@@ -1439,6 +1441,8 @@ int RGWBucketAdminOp::check_index(rgw::sal::Store* store, RGWBucketAdminOpState&
     return ret;
 
   dump_index_check(existing_stats, calculated_stats, formatter);
+  
+  formatter->close_section();
   flusher.flush();
 
   return 0;