]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix #7187: Include all summary items in JSON health output
authorJohn Spray <john.spray@inktank.com>
Mon, 20 Jan 2014 11:08:27 +0000 (11:08 +0000)
committerSage Weil <sage@inktank.com>
Mon, 20 Jan 2014 20:11:31 +0000 (12:11 -0800)
Signed-off-by: John Spray <john.spray@inktank.com>
(cherry picked from commit fdf3b5520d150f14d90bdfc569b70c07b0579b38)

src/mon/Monitor.cc

index 74330d11e3c77d7793d07d81b388c6fad79396f8..119ca4b0761586101ab57ed4ea7a5d32a941dd3c 100644 (file)
@@ -1739,17 +1739,17 @@ void Monitor::get_health(string& status, bufferlist *detailbl, Formatter *f)
   stringstream ss;
   health_status_t overall = HEALTH_OK;
   if (!summary.empty()) {
-    if (f) {
-      f->open_object_section("item");
-      f->dump_stream("severity") <<  summary.front().first;
-      f->dump_string("summary", summary.front().second);
-      f->close_section();
-    }
     ss << ' ';
     while (!summary.empty()) {
       if (overall > summary.front().first)
        overall = summary.front().first;
       ss << summary.front().second;
+      if (f) {
+        f->open_object_section("item");
+        f->dump_stream("severity") <<  summary.front().first;
+        f->dump_string("summary", summary.front().second);
+        f->close_section();
+      }
       summary.pop_front();
       if (!summary.empty())
        ss << "; ";