From e4d0eeefa2804889cd7a86d3610f1739a97eb50b Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 22 Jul 2013 21:54:16 -0700 Subject: [PATCH] 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 --- qa/workunits/rest/test.py | 4 ++-- src/mon/MDSMonitor.cc | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/workunits/rest/test.py b/qa/workunits/rest/test.py index 272760c82892b..fc7e82c9b6161 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 172f0f1e3dbee..f0fb4ae83324a 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; -- 2.39.5