]> git.apps.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:42 +0000 (12:11 -0800)
Signed-off-by: John Spray <john.spray@inktank.com>
(cherry picked from commit fdf3b5520d150f14d90bdfc569b70c07b0579b38)

src/mon/Monitor.cc

index cd541f6bf836062d91073ee3b5c1b965a8038aa3..1964656d03733a758d57515d1913387cb5e57e06 100644 (file)
@@ -1703,17 +1703,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 << "; ";