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:
parent
aa0583eaf4
commit
6b998a9529
@ -926,13 +926,17 @@ def do_backup_delete(cs, args):
|
|||||||
@utils.arg('backup', metavar='<backup>',
|
@utils.arg('backup', metavar='<backup>',
|
||||||
help='ID of the backup to restore.')
|
help='ID of the backup to restore.')
|
||||||
@utils.arg('--volume-id', metavar='<volume>',
|
@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.',
|
help='Optional ID(or name) of the volume to restore to.',
|
||||||
default=None)
|
default=None)
|
||||||
@utils.service_type('volumev2')
|
@utils.service_type('volumev2')
|
||||||
def do_backup_restore(cs, args):
|
def do_backup_restore(cs, args):
|
||||||
"""Restore a backup."""
|
"""Restore a backup."""
|
||||||
if args.volume_id:
|
vol = args.volume or args.volume_id
|
||||||
volume_id = utils.find_volume(cs, args.volume_id).id
|
if vol:
|
||||||
|
volume_id = utils.find_volume(cs, vol).id
|
||||||
else:
|
else:
|
||||||
volume_id = None
|
volume_id = None
|
||||||
cs.restores.restore(args.backup, volume_id)
|
cs.restores.restore(args.backup, volume_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user