]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd: adjusted "showmapped" JSON and XML formatted output
authorMykola Golub <mgolub@suse.com>
Fri, 12 Jan 2018 15:03:26 +0000 (17:03 +0200)
committerMykola Golub <mgolub@suse.com>
Fri, 12 Jan 2018 19:36:00 +0000 (21:36 +0200)
Signed-off-by: Mykola Golub <mgolub@suse.com>
PendingReleaseNotes
qa/tasks/rbd_fio.py
src/krbd.cc

index 8922cec2eba9450c736112f9920a02c3d2b49236..ee75b317fa0bb48383674d9b17359bba150527ee 100644 (file)
@@ -29,6 +29,8 @@
 
   * The rbd CLI's "lock list" JSON and XML output has changed.
 
+  * The rbd CLI's "showmapped" JSON and XML output has changed.
+
 * The sample ``crush-location-hook`` script has been removed.  Its output is
   equivalent to the built-in default behavior, so it has been replaced with an
   example in the CRUSH documentation.
index 663e8f524b4bd12b944727f4d303f6025925a53f..bbd6ce0c6e913e57832b6d353ba1a068d9a8ecf5 100644 (file)
@@ -218,7 +218,7 @@ def run_fio(remote, config, rbd_test_dir):
         mapped_images = json.loads(out.getvalue())
         if mapped_images:
             log.info("Unmapping rbd images on {sn}".format(sn=sn))
-            for image in mapped_images.itervalues():
+            for image in mapped_images:
                 remote.run(args=['sudo', 'rbd', 'unmap', str(image['device'])])
         log.info("Cleaning up fio install")
         remote.run(args=['rm','-rf', run.Raw(rbd_test_dir)])
index 45f41e2d96b61bbff5b42e78be39ebcd0b6ebc2f..cdc45e7dddcfde0681e5e118c7f9aee08a81c915 100644 (file)
@@ -639,7 +639,8 @@ static bool dump_one_image(Formatter *f, TextTable *tbl,
     return false;
 
   if (f) {
-    f->open_object_section(id);
+    f->open_object_section("device");
+    f->dump_string("id", id);
     f->dump_string("pool", pool);
     f->dump_string("name", image);
     f->dump_string("snap", snap);
@@ -693,7 +694,7 @@ int dump_images(struct krbd_ctx *ctx, Formatter *f)
   int r;
 
   if (f) {
-    f->open_object_section("devices");
+    f->open_array_section("devices");
   } else {
     tbl.define_column("id", TextTable::LEFT, TextTable::LEFT);
     tbl.define_column("pool", TextTable::LEFT, TextTable::LEFT);