From: songweibin Date: Thu, 17 Aug 2017 03:44:43 +0000 (+0800) Subject: common: add new line break when get command descriptions X-Git-Tag: v12.2.1~75^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F17467%2Fhead;p=ceph.git common: add new line break when get command descriptions Signed-off-by: songweibin (cherry picked from commit 19dd4203eb930ffb7a321cb617c580d99ceca9c1) --- diff --git a/src/common/admin_socket.cc b/src/common/admin_socket.cc index 2bb767edcff7..dc15dbb84b9d 100644 --- a/src/common/admin_socket.cc +++ b/src/common/admin_socket.cc @@ -536,7 +536,7 @@ public: explicit GetdescsHook(AdminSocket *as) : m_as(as) {} bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override { int cmdnum = 0; - JSONFormatter jf(false); + JSONFormatter jf; jf.open_object_section("command_descriptions"); for (map::iterator p = m_as->m_descs.begin(); p != m_as->m_descs.end(); @@ -550,6 +550,7 @@ public: cmdnum++; } jf.close_section(); // command_descriptions + jf.enable_line_break(); ostringstream ss; jf.flush(ss); out.append(ss.str());