Show volume and snapshot data on create

nova volume-create and nova volume-snapshot-create do not display
the data returned from the api.  This makes it difficult to find
the id of of the newly created object.

Fixes bug 1053432

Change-Id: Ie25566f4e7d05d98421a5ea9e75521d40282a40d
This commit is contained in:
Vishvananda Ishaya 2012-09-20 14:31:52 +00:00
parent bfb0f70f40
commit 02d3aaddf2

@ -1124,13 +1124,14 @@ def do_volume_show(cs, args):
@utils.service_type('volume')
def do_volume_create(cs, args):
"""Add a new volume."""
cs.volumes.create(args.size,
args.snapshot_id,
args.display_name,
args.display_description,
args.volume_type,
args.availability_zone,
imageRef=args.image_id)
volume = cs.volumes.create(args.size,
args.snapshot_id,
args.display_name,
args.display_description,
args.volume_type,
args.availability_zone,
imageRef=args.image_id)
_print_volume(volume)
@utils.arg('volume', metavar='<volume>', help='ID of the volume to delete.')
@ -1213,10 +1214,11 @@ def do_volume_snapshot_show(cs, args):
@utils.service_type('volume')
def do_volume_snapshot_create(cs, args):
"""Add a new snapshot."""
cs.volume_snapshots.create(args.volume_id,
args.force,
args.display_name,
args.display_description)
snapshot = cs.volume_snapshots.create(args.volume_id,
args.force,
args.display_name,
args.display_description)
_print_volume_snapshot(snapshot)
@utils.arg('snapshot_id',