Merge pull request #1747 from eeroniemi/devel

Fixed parameter validation when creating a volume from a snapshot
This commit is contained in:
Brian Coca 2015-07-17 12:09:10 -04:00
commit 89edbfa269

View file

@ -436,11 +436,11 @@ def main():
# Delaying the checks until after the instance check allows us to get volume ids for existing volumes
# without needing to pass an unused volume_size
if not volume_size and not (id or name):
module.fail_json(msg="You must specify an existing volume with id or name or a volume_size")
if not volume_size and not (id or name or snapshot):
module.fail_json(msg="You must specify volume_size or identify an existing volume by id, name, or snapshot")
if volume_size and id:
module.fail_json(msg="Cannot specify volume_size and id")
if volume_size and (id or snapshot):
module.fail_json(msg="Cannot specify volume_size together with id or snapshot")
if state == 'absent':
delete_volume(module, ec2)