]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: "mds stat" must open/close section around dump_info
authorDan Mick <dan.mick@inktank.com>
Tue, 23 Jul 2013 04:54:16 +0000 (21:54 -0700)
committerDan Mick <dan.mick@inktank.com>
Tue, 23 Jul 2013 21:03:52 +0000 (14:03 -0700)
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>
qa/workunits/rest/test.py
src/mon/MDSMonitor.cc

index 272760c82892bd9e7c56ca786602362994086ae7..fc7e82c9b6161c827b2e1a65d00a7e30b6908230 100755 (executable)
@@ -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')
index 172f0f1e3dbeebcd429ef92ac9137a69b61337e8..f0fb4ae83324a5c6fc7057d8e419b916c60e591c 100644 (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;