Deprecates --volume-id arg for v2 backup-restore

This patch deprecates the --volume-id arg of backup-restore
when using the v2 api and adds (preferred) --volume arg.
Both args are still usable but the former is now listed as
"Deprecated" in the help message.

Change-Id: I2575d93041b26f971c59bc04828b356556617b62
Fixes: bug 1242816
This commit is contained in:
Edward Hope-Morley 2013-10-22 16:36:17 -07:00
parent aa0583eaf4
commit 6b998a9529

@ -926,13 +926,17 @@ def do_backup_delete(cs, args):
@utils.arg('backup', metavar='<backup>',
help='ID of the backup to restore.')
@utils.arg('--volume-id', metavar='<volume>',
help=argparse.SUPPRESS,
default=None)
@utils.arg('--volume', metavar='<volume>',
help='Optional ID(or name) of the volume to restore to.',
default=None)
@utils.service_type('volumev2')
def do_backup_restore(cs, args):
"""Restore a backup."""
if args.volume_id:
volume_id = utils.find_volume(cs, args.volume_id).id
vol = args.volume or args.volume_id
if vol:
volume_id = utils.find_volume(cs, vol).id
else:
volume_id = None
cs.restores.restore(args.backup, volume_id)