rbd: adjusted "showmapped" JSON and XML formatted output

Signed-off-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
Mykola Golub 2018-01-12 17:03:26 +02:00
parent 443a7f5f7c
commit de97a3be48
3 changed files with 6 additions and 3 deletions

View 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.

View 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)])

View 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);