From 9bcba944c6586ad5f007c0a30e69c6b5a886510b Mon Sep 17 00:00:00 2001 From: Concubidated Date: Fri, 8 Mar 2013 13:44:39 -0800 Subject: [PATCH] Fix output of 'ceph osd tree --format=json' Signed-off-by: Tyler Brekke --- src/osd/OSDMap.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 2b197d9f2ab..e3188bad696 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1598,14 +1598,12 @@ void OSDMap::print_tree(ostream *out, Formatter *f) const if (out) *out << "\n"; if (f) { + f->dump_float("crush_weight", weight); + f->dump_unsigned("depth", depth); f->close_section(); } touched.insert(cur); } - if (f) { - f->dump_float("crush_weight", weight); - f->dump_unsigned("depth", depth); - } if (cur >= 0) { continue; }