Merge "Add evaluation of --force parameter when creating snapshots"

This commit is contained in:
Jenkins 2013-07-31 01:58:54 +00:00 committed by Gerrit Code Review
commit 1329e0b94f
2 changed files with 11 additions and 0 deletions
cinderclient

@ -420,6 +420,12 @@ def do_snapshot_show(cs, args):
@utils.service_type('volume')
def do_snapshot_create(cs, args):
"""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,
args.force,
args.display_name,

@ -477,6 +477,11 @@ def do_snapshot_create(cs, args):
if args.display_description is not None:
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,
args.force,
args.name,