]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix output of 'ceph osd tree --format=json'
authorConcubidated <tyler.brekke@inktank.com>
Fri, 8 Mar 2013 21:44:39 +0000 (13:44 -0800)
committerSage Weil <sage@inktank.com>
Fri, 8 Mar 2013 21:51:34 +0000 (13:51 -0800)
Signed-off-by: Tyler Brekke <tyler.brekke@inktank.com>
(cherry picked from commit 9bcba944c6586ad5f007c0a30e69c6b5a886510b)

src/osd/OSDMap.cc

index 83eeb8cb78d7f89af176c391dcaf9a730f45eec8..460605259f961d1415a1c6a2cc756e327d65866e 100644 (file)
@@ -1512,14 +1512,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;
       }