From: Jason Dillaman Date: Mon, 5 Oct 2020 20:08:38 +0000 (-0400) Subject: rbd: cleanup code and output formatting in status action X-Git-Tag: v16.1.0~903^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00b86644cd5ffdbb3f96ed1f174b11cbbcf0b90d;p=ceph.git rbd: cleanup code and output formatting in status action Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd/action/Status.cc b/src/tools/rbd/action/Status.cc index db9b69bf6df1..6e5e39a42307 100644 --- a/src/tools/rbd/action/Status.cc +++ b/src/tools/rbd/action/Status.cc @@ -174,12 +174,12 @@ static int do_show_status(librados::IoCtx& io_ctx, const std::string &image_name f->close_section(); // migration } if (cache_state.present) { - f->open_object_section("image_cache_state"); - f->dump_bool("clean", cache_state.clean); - f->dump_int("size", cache_state.size); - f->dump_string("host", cache_state.host); - f->dump_string("path", cache_state.path); - f->close_section(); // image_cache_state + f->open_object_section("image_cache_state"); + f->dump_bool("clean", cache_state.clean); + f->dump_int("size", cache_state.size); + f->dump_string("host", cache_state.host); + f->dump_string("path", cache_state.path); + f->close_section(); // image_cache_state } } else { if (watchers.size()) { @@ -201,7 +201,7 @@ static int do_show_status(librados::IoCtx& io_ctx, const std::string &image_name std::cout << "Migration:" << std::endl; std::cout << "\tsource: " << source_pool_name << "/" - << migration_status.source_image_name; + << migration_status.source_image_name; if (!migration_status.source_image_id.empty()) { std::cout << " (" << migration_status.source_image_id << ")"; } @@ -217,11 +217,12 @@ static int do_show_status(librados::IoCtx& io_ctx, const std::string &image_name } if (cache_state.present) { - std::cout << "image cache state:" << std::endl; + std::cout << "Image cache state:" << std::endl; std::cout << "\tclean: " << (cache_state.clean ? "true" : "false") - << " size: " << byte_u_t(cache_state.size) - << " host: " << cache_state.host - << " path: " << cache_state.path << std::endl; + << std::endl + << "\tsize: " << byte_u_t(cache_state.size) << std::endl + << "\thost: " << cache_state.host << std::endl + << "\tpath: " << cache_state.path << std::endl; } }