From: Dan Mick Date: Tue, 23 Jul 2013 04:54:16 +0000 (-0700) Subject: mon: "mds stat" must open/close section around dump_info X-Git-Tag: v0.67-rc2~15^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e4d0eeefa2804889cd7a86d3610f1739a97eb50b;p=ceph.git mon: "mds stat" must open/close section around dump_info dump_info() got a new field outside the mdsmap section; it's ok for the overall "report", but not for "mds stat". Add an enclosing section in "mds stat". Fix test to expect new level. Fixes: #5718 Signed-off-by: Dan Mick Reviewed-by: Sage Weil --- diff --git a/qa/workunits/rest/test.py b/qa/workunits/rest/test.py index 272760c82892..fc7e82c9b616 100755 --- a/qa/workunits/rest/test.py +++ b/qa/workunits/rest/test.py @@ -188,9 +188,9 @@ if __name__ == '__main__': assert(r.json['output']['max_mds'] == 4) expect('mds/set_max_mds?maxmds=3', 'PUT', 200, '') r = expect('mds/stat.json', 'GET', 200, 'json') - assert('info' in r.json['output']) + assert('info' in r.json['output']['mdsmap']) r = expect('mds/stat.xml', 'GET', 200, 'xml') - assert(r.tree.find('output/mdsmap/info') is not None) + assert(r.tree.find('output/mds_stat/mdsmap/info') is not None) # more content tests below, just check format here expect('mon/dump.json', 'GET', 200, 'json') diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 172f0f1e3dbe..f0fb4ae83324 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -563,7 +563,9 @@ bool MDSMonitor::preprocess_command(MMonCommand *m) if (prefix == "mds stat") { if (f) { + f->open_object_section("mds_stat"); dump_info(f.get()); + f->close_section(); f->flush(ds); } else { ds << mdsmap;