]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix json formatting for image and journal status output 12741/head
authorMykola Golub <mgolub@mirantis.com>
Fri, 16 Dec 2016 10:50:50 +0000 (12:50 +0200)
committerNathan Cutler <ncutler@suse.com>
Mon, 2 Jan 2017 11:14:50 +0000 (12:14 +0100)
Fixes: http://tracker.ceph.com/issues/18261
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit 4c2659a0f49ff5f709a8275d6adaa817daf8f76a)

src/tools/rbd/action/Journal.cc
src/tools/rbd/action/Status.cc

index cf8ec554353a68d9ddd7aa63ae793dea23487df8..fd87543ecd5d37732e728cde087a6e196a32cb1e 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 ab37bc8644c1b077b5f3d52b81a0c1aede8d8627..a6657c46f5a661e64f4d2e6de571abf4ed1b26ae 100644 (file)
@@ -54,7 +54,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);