Merge "Add evaluation of --force parameter when creating snapshots"
This commit is contained in:
@@ -420,6 +420,12 @@ def do_snapshot_show(cs, args):
|
|||||||
@utils.service_type('volume')
|
@utils.service_type('volume')
|
||||||
def do_snapshot_create(cs, args):
|
def do_snapshot_create(cs, args):
|
||||||
"""Add a new snapshot."""
|
"""Add a new snapshot."""
|
||||||
|
|
||||||
|
if not args.force.lower() in ['true', '1', 'yes', 'y',
|
||||||
|
'false', '0', 'no', 'n']:
|
||||||
|
msg = "Parameter 'force' does not support value '%s'" % args.force
|
||||||
|
raise exceptions.BadRequest(msg)
|
||||||
|
|
||||||
snapshot = cs.volume_snapshots.create(args.volume_id,
|
snapshot = cs.volume_snapshots.create(args.volume_id,
|
||||||
args.force,
|
args.force,
|
||||||
args.display_name,
|
args.display_name,
|
||||||
|
@@ -477,6 +477,11 @@ def do_snapshot_create(cs, args):
|
|||||||
if args.display_description is not None:
|
if args.display_description is not None:
|
||||||
args.description = args.display_description
|
args.description = args.display_description
|
||||||
|
|
||||||
|
if not args.force.lower() in ['true', '1', 'yes', 'y',
|
||||||
|
'false', '0', 'no', 'n']:
|
||||||
|
msg = "Parameter 'force' does not support value '%s'" % args.force
|
||||||
|
raise exceptions.BadRequest(msg)
|
||||||
|
|
||||||
snapshot = cs.volume_snapshots.create(args.volume_id,
|
snapshot = cs.volume_snapshots.create(args.volume_id,
|
||||||
args.force,
|
args.force,
|
||||||
args.name,
|
args.name,
|
||||||
|
Reference in New Issue
Block a user