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 <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Dan Mick 2013-07-22 21:54:16 -07:00
parent 3a69fd0456
commit e4d0eeefa2
2 changed files with 4 additions and 2 deletions

View File

@ -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')

View File

@ -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;