diff --git a/cinderclient/v1/shell.py b/cinderclient/v1/shell.py index 140d59c79..f85a4c295 100644 --- a/cinderclient/v1/shell.py +++ b/cinderclient/v1/shell.py @@ -579,11 +579,12 @@ def do_type_create(cs, args): @utils.arg('id', metavar='', - help="Unique ID of the volume type to delete") + help="Name or ID of the volume type to delete") @utils.service_type('volume') def do_type_delete(cs, args): """Delete a specific volume type.""" - cs.volume_types.delete(args.id) + volume_type = _find_volume_type(cs, args.id) + cs.volume_types.delete(volume_type) @utils.arg('vtype', diff --git a/cinderclient/v1/volume_types.py b/cinderclient/v1/volume_types.py index e8b2c3984..abfa43ede 100644 --- a/cinderclient/v1/volume_types.py +++ b/cinderclient/v1/volume_types.py @@ -101,7 +101,7 @@ class VolumeTypeManager(base.ManagerWithFind): """ Delete a specific volume_type. - :param volume_type: The ID of the :class:`VolumeType` to get. + :param volume_type: The name or ID of the :class:`VolumeType` to get. """ self._delete("/types/%s" % base.getid(volume_type)) diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index 129fc8220..2e48339cd 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -637,11 +637,12 @@ def do_type_create(cs, args): @utils.arg('id', metavar='', - help="Unique ID of the volume type to delete") + help="Name or ID of the volume type to delete") @utils.service_type('volumev2') def do_type_delete(cs, args): """Delete a specific volume type.""" - cs.volume_types.delete(args.id) + volume_type = _find_volume_type(cs, args.id) + cs.volume_types.delete(volume_type) @utils.arg('vtype', diff --git a/cinderclient/v2/volume_types.py b/cinderclient/v2/volume_types.py index 3d7630242..26b396f1d 100644 --- a/cinderclient/v2/volume_types.py +++ b/cinderclient/v2/volume_types.py @@ -88,7 +88,7 @@ class VolumeTypeManager(base.ManagerWithFind): def delete(self, volume_type): """Delete a specific volume_type. - :param volume_type: The ID of the :class:`VolumeType` to get. + :param volume_type: The name or ID of the :class:`VolumeType` to get. """ self._delete("/types/%s" % base.getid(volume_type))