From: David Zafman Date: Thu, 11 Jun 2015 00:04:57 +0000 (-0700) Subject: tools: Fix newlines in output of --op list X-Git-Tag: v9.0.3~48^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6aec38b51f0c14684912b5ee28fb5b1375cb8f8a;p=ceph.git tools: Fix newlines in output of --op list Signed-off-by: David Zafman --- diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index bc031b68d7890..6454b34848668 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -227,10 +227,6 @@ struct pgid_object_list { for (list >::const_iterator i = _objects.begin(); i != _objects.end(); ++i) { - if (i != _objects.begin() && human_readable) { - f->flush(cout); - cout << std::endl; - } f->open_array_section("pgid_object"); spg_t pgid; if (i->first.is_pg(&pgid)) @@ -239,9 +235,16 @@ struct pgid_object_list { i->second.dump(f); f->close_section(); f->close_section(); + if (human_readable) { + f->flush(cout); + cout << std::endl; + } } - if (!human_readable) + if (!human_readable) { f->close_section(); + f->flush(cout); + cout << std::endl; + } } }; @@ -1380,7 +1383,6 @@ int do_list(ObjectStore *store, string pgidstr, string object, Formatter *format return r; lookup.dump(formatter, human_readable); formatter->flush(cout); - cout << std::endl; return 0; }