]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: add open/close section when listing group images
authorsongweibin <song.weibin@zte.com.cn>
Wed, 31 Jan 2018 05:46:06 +0000 (13:46 +0800)
committersongweibin <song.weibin@zte.com.cn>
Wed, 31 Jan 2018 09:34:36 +0000 (17:34 +0800)
Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/tools/rbd/action/Group.cc

index 336a07df7679c546d642e3c64305d6eea1ea795e..88badde20640b35d5bfc2aee8ed269baac2fc343 100644 (file)
@@ -318,9 +318,11 @@ int execute_list_images(const po::variables_map &vm,
     }
 
     if (f) {
-      f->dump_string("image name", image_name);
+      f->open_object_section("image");
+      f->dump_string("image", image_name);
       f->dump_string("pool", pool_name);
       f->dump_int("state", state);
+      f->close_section();
     } else
       std::cout << pool_name << "/" << image_name << " " << state_string << std::endl;
   }
@@ -511,7 +513,7 @@ int execute_group_snap_list(const po::variables_map &vm,
     }
     if (f) {
       f->open_object_section("group_snap");
-      f->dump_string("snap name", snap_name);
+      f->dump_string("snapshot", snap_name);
       f->dump_string("state", state_string);
       f->close_section();
     } else {