From: Concubidated Date: Fri, 8 Mar 2013 21:44:39 +0000 (-0800) Subject: Fix output of 'ceph osd tree --format=json' X-Git-Tag: v0.60~111^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F96%2Fhead;p=ceph.git Fix output of 'ceph osd tree --format=json' Signed-off-by: Tyler Brekke --- 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; }