From 870e7ddbcce5d5f1b1bd36bb3ad95665565b3ced Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 9 May 2014 09:28:53 -0500 Subject: Change volume create --volume-type to --type This makes it consistent with the other --type options in OSC. Also add a few more volume_create tests. Change-Id: I50ef927932cabf157ecdfd6c4faa1914b4fdf413 --- openstackclient/volume/v1/volume.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'openstackclient/volume') diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py index 928ed76b..cad53eb1 100644 --- a/openstackclient/volume/v1/volume.py +++ b/openstackclient/volume/v1/volume.py @@ -56,7 +56,7 @@ class CreateVolume(show.ShowOne): help='Description of the volume', ) parser.add_argument( - '--volume-type', + '--type', metavar='', help='Type of volume', ) @@ -124,7 +124,7 @@ class CreateVolume(show.ShowOne): source_volume, parsed_args.name, parsed_args.description, - parsed_args.volume_type, + parsed_args.type, user, project, parsed_args.availability_zone, @@ -133,7 +133,10 @@ class CreateVolume(show.ShowOne): ) # Map 'metadata' column to 'properties' volume._info.update( - {'properties': utils.format_dict(volume._info.pop('metadata'))} + { + 'properties': utils.format_dict(volume._info.pop('metadata')), + 'type': volume._info.pop('volume_type'), + }, ) return zip(*sorted(six.iteritems(volume._info))) @@ -331,7 +334,10 @@ class ShowVolume(show.ShowOne): volume = utils.find_resource(volume_client.volumes, parsed_args.volume) # Map 'metadata' column to 'properties' volume._info.update( - {'properties': utils.format_dict(volume._info.pop('metadata'))} + { + 'properties': utils.format_dict(volume._info.pop('metadata')), + 'type': volume._info.pop('volume_type'), + }, ) if 'os-vol-tenant-attr:tenant_id' in volume._info: volume._info.update( -- cgit v1.2.1