From: Gaurav Kumar Garg Date: Fri, 30 Dec 2016 10:31:00 +0000 (+0100) Subject: rbd: remove unused condition X-Git-Tag: v12.0.0~312^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=98a802ab7a819c3d16aec38e4a4a83be2e1f97fa;p=ceph.git rbd: remove unused condition Signed-off-by: Gaurav Kumar Garg --- diff --git a/src/tools/rbd/action/Group.cc b/src/tools/rbd/action/Group.cc index 5a8dcd53256..6fbaefdee6d 100644 --- a/src/tools/rbd/action/Group.cc +++ b/src/tools/rbd/action/Group.cc @@ -261,11 +261,13 @@ int execute_list_images(const po::variables_map &vm) { if (r == -ENOENT) r = 0; + if (r < 0) return r; if (f) f->open_array_section("consistency_groups"); + for (auto i : images) { std::string image_name = i.name; int64_t pool_id = i.pool; @@ -274,8 +276,6 @@ int execute_list_images(const po::variables_map &vm) { if (cls::rbd::GROUP_IMAGE_LINK_STATE_INCOMPLETE == state) { state_string = "incomplete"; } - if (r < 0) - return r; if (f) { f->dump_string("image name", image_name); f->dump_int("pool id", pool_id); @@ -283,6 +283,7 @@ int execute_list_images(const po::variables_map &vm) { } else std::cout << pool_id << "." << image_name << " " << state_string << std::endl; } + if (f) { f->close_section(); f->flush(std::cout);