]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: cleanup code and output formatting in status action 37556/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 5 Oct 2020 20:08:38 +0000 (16:08 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 6 Oct 2020 13:35:24 +0000 (09:35 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd/action/Status.cc

index db9b69bf6df1c2d8ae967185ab19ee8469e89f1b..6e5e39a423074a1e8e2210e5c8ac4f372e177f29 100644 (file)
@@ -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;
     }
   }