Skip to content

Commit

Permalink
Fix some usage messages of 'nova volume-*'
Browse files Browse the repository at this point in the history
'nova volume-show', 'nova volume-delete', 'nova volume-snapshot-show'
and 'nova volume-snapshot-delete' can be specified by ID or name as
the argument.
But that is not described on the usage messages.
This patch fixes the usage messages.

Fixes bug 1093172

Change-Id: I3dcdd2aca923e9304efd9ea7b467d5b81cd642a7
  • Loading branch information
Ken'ichi Ohmichi committed Dec 22, 2012
1 parent fba20df commit 4cf314b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions novaclient/v1_1/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,12 +1245,12 @@ def do_remove_fixed_ip(cs, args):


def _find_volume(cs, volume):
"""Get a volume by ID."""
"""Get a volume by name or ID."""
return utils.find_resource(cs.volumes, volume)


def _find_volume_snapshot(cs, snapshot):
"""Get a volume snapshot by ID."""
"""Get a volume snapshot by name or ID."""
return utils.find_resource(cs.volume_snapshots, snapshot)


Expand Down Expand Up @@ -1308,7 +1308,7 @@ def do_volume_list(cs, args):
'Size', 'Volume Type', 'Attached to'])


@utils.arg('volume', metavar='<volume>', help='ID of the volume.')
@utils.arg('volume', metavar='<volume>', help='Name or ID of the volume.')
@utils.service_type('volume')
def do_volume_show(cs, args):
"""Show details about a volume."""
Expand Down Expand Up @@ -1364,7 +1364,9 @@ def do_volume_create(cs, args):
_print_volume(volume)


@utils.arg('volume', metavar='<volume>', help='ID of the volume to delete.')
@utils.arg('volume',
metavar='<volume>',
help='Name or ID of the volume to delete.')
@utils.service_type('volume')
def do_volume_delete(cs, args):
"""Remove a volume."""
Expand Down Expand Up @@ -1413,7 +1415,9 @@ def do_volume_snapshot_list(cs, _args):
'Size'])


@utils.arg('snapshot', metavar='<snapshot>', help='ID of the snapshot.')
@utils.arg('snapshot',
metavar='<snapshot>',
help='Name or ID of the snapshot.')
@utils.service_type('volume')
def do_volume_snapshot_show(cs, args):
"""Show details about a snapshot."""
Expand Down Expand Up @@ -1451,13 +1455,13 @@ def do_volume_snapshot_create(cs, args):
_print_volume_snapshot(snapshot)


@utils.arg('snapshot_id',
metavar='<snapshot-id>',
help='ID of the snapshot to delete.')
@utils.arg('snapshot',
metavar='<snapshot>',
help='Name or ID of the snapshot to delete.')
@utils.service_type('volume')
def do_volume_snapshot_delete(cs, args):
"""Remove a snapshot."""
snapshot = _find_volume_snapshot(cs, args.snapshot_id)
snapshot = _find_volume_snapshot(cs, args.snapshot)
snapshot.delete()


Expand Down

0 comments on commit 4cf314b

Please sign in to comment.