]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix json formatting for image and journal status output 12525/head
authorMykola Golub <mgolub@mirantis.com>
Fri, 16 Dec 2016 10:50:50 +0000 (12:50 +0200)
committerMykola Golub <mgolub@mirantis.com>
Fri, 16 Dec 2016 10:50:50 +0000 (12:50 +0200)
Fixes: http://tracker.ceph.com/issues/18261
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/tools/rbd/action/Journal.cc
src/tools/rbd/action/Status.cc

index b90a88ec1c81b039948c780cd840a7603f43d8c7..0e3e6b3d62cc90f23f238de495165aac05592198 100644 (file)
@@ -111,10 +111,12 @@ static int do_show_journal_status(librados::IoCtx& io_ctx,
     f->open_object_section("status");
     f->dump_unsigned("minimum_set", minimum_set);
     f->dump_unsigned("active_set", active_set);
-    f->open_object_section("registered_clients");
+    f->open_array_section("registered_clients");
     for (std::set<cls::journal::Client>::iterator c =
           registered_clients.begin(); c != registered_clients.end(); ++c) {
+      f->open_object_section("client");
       c->dump(f);
+      f->close_section();
     }
     f->close_section();
     f->close_section();
index a6944f0d1a571b43516ecacd95d75a8c80e539d2..9d2951e4a29efb5b4cfe2737f275072324063403 100644 (file)
@@ -50,7 +50,7 @@ static int do_show_status(librados::IoCtx &io_ctx, librbd::Image &image,
     f->open_object_section("status");
 
   if (f) {
-    f->open_object_section("watchers");
+    f->open_array_section("watchers");
     for (std::list<obj_watch_t>::iterator i = watchers.begin(); i != watchers.end(); ++i) {
       f->open_object_section("watcher");
       f->dump_string("address", i->addr);