]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make report pure json
authorSage Weil <sage@inktank.com>
Mon, 15 Jul 2013 21:29:14 +0000 (14:29 -0700)
committerSage Weil <sage@inktank.com>
Mon, 15 Jul 2013 21:29:14 +0000 (14:29 -0700)
Put the crc in the status string and drop the header and footer.  If users
want to capture it,

ceph report 2>&1 > foo.txt

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc

index 82b57c2e7bba2b54228007959e433d0355f6600b..1282cb359cac49503a638a9d0a16a70c92d2b4f9 100644 (file)
@@ -2135,16 +2135,11 @@ void Monitor::handle_command(MMonCommand *m)
     paxos->dump_info(f.get());
 
     f->close_section();
-    f->flush(ds);
+    f->flush(rdata);
 
-    bufferlist bl;
-    bl.append("-------- BEGIN REPORT --------\n");
-    bl.append(ds);
     ostringstream ss2;
-    ss2 << "\n-------- END REPORT " << bl.crc32c(6789) << " --------\n";
-    rdata.append(bl);
-    rdata.append(ss2.str());
-    rs = string();
+    ss2 << "report " << rdata.crc32c(6789);
+    rs = ss2.str();
     r = 0;
   } else if (prefix == "quorum_status") {
     if (!access_r) {