diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-02-21 09:10:15 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-02-21 09:10:15 +0800 |
| commit | acc0297fa61f1dbc23ac5106ea26fc940339c9aa (patch) | |
| tree | c37e8478106c1b08a5b415c2aaee1c65736ab233 /openstackclient/volume | |
| parent | 5a978b9ec137cece167f0164dbb1754002a81bec (diff) | |
| download | python-openstackclient-acc0297fa61f1dbc23ac5106ea26fc940339c9aa.tar.gz | |
Add functional tests for "volume" commands v2
The tests for v2 "volume" commands are quite similar to v1.
This patch also map 'metadata' to 'properties', 'volume_type' to 'type'
to align to the v1 output.
Change-Id: Icf2c5463b186fc78c890ccd96453090c4a2c2eb6
Partial-bug: #1519503
Diffstat (limited to 'openstackclient/volume')
| -rw-r--r-- | openstackclient/volume/v2/volume.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py index 436ec689..87affd07 100644 --- a/openstackclient/volume/v2/volume.py +++ b/openstackclient/volume/v2/volume.py @@ -394,6 +394,16 @@ class ShowVolume(command.ShowOne): volume_client = self.app.client_manager.volume volume = utils.find_resource(volume_client.volumes, parsed_args.volume) + # Special mapping for columns to make the output easier to read: + # 'metadata' --> 'properties' + # 'volume_type' --> 'type' + volume._info.update( + { + 'properties': utils.format_dict(volume._info.pop('metadata')), + 'type': volume._info.pop('volume_type'), + }, + ) + # Remove key links from being displayed volume._info.pop("links", None) return zip(*sorted(six.iteritems(volume._info))) |
