From fdf3b5520d150f14d90bdfc569b70c07b0579b38 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 20 Jan 2014 11:08:27 +0000 Subject: [PATCH] Fix #7187: Include all summary items in JSON health output Signed-off-by: John Spray --- src/mon/Monitor.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 4d583a0b8a377..6b88e9994f09c 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1758,17 +1758,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 << "; "; -- 2.39.5