From 23f7d19739c66e28efd425df6bd4314f9a0cc961 Mon Sep 17 00:00:00 2001 From: Karthik Prabhu Vinod Date: Tue, 21 Jun 2016 20:40:18 +0000 Subject: [PATCH] Showing the metadata readonly value as a separate field Now, cinder show , shows readonly as a separate field. This helps the user to not have to scan all through the volume's metadata field Change-Id: Ib427f7e76e8e28fee97b75413c3032fbee75af86 Closes-bug: #1307098 --- cinderclient/v3/shell.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py index 9cac23d5f..bd0290b22 100644 --- a/cinderclient/v3/shell.py +++ b/cinderclient/v3/shell.py @@ -299,6 +299,9 @@ def do_show(cs, args): volume = utils.find_volume(cs, args.volume) info.update(volume._info) + if 'readonly' in info['metadata']: + info['readonly'] = info['metadata']['readonly'] + info.pop('links', None) utils.print_dict(info, formatters=['metadata', 'volume_image_metadata']) @@ -449,6 +452,9 @@ def do_create(cs, args): volume = cs.volumes.get(volume.id) info.update(volume._info) + if 'readonly' in info['metadata']: + info['readonly'] = info['metadata']['readonly'] + info.pop('links', None) utils.print_dict(info)