rbd: fix json formatting for image and journal status output

Fixes: http://tracker.ceph.com/issues/18261
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
Mykola Golub 2016-12-16 12:50:50 +02:00
parent 8d7d5ae3ff
commit 4c2659a0f4
2 changed files with 4 additions and 2 deletions

View 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();

View 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);