From 3533f3953438be8e3b860a2cf514dbd192c26552 Mon Sep 17 00:00:00 2001 From: Eero Niemi Date: Fri, 17 Jul 2015 16:54:39 +0300 Subject: [PATCH] Fixed parameter validation when creating a volume from a snapshot --- cloud/amazon/ec2_vol.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud/amazon/ec2_vol.py b/cloud/amazon/ec2_vol.py index 712be248af3..0d275cc91d7 100644 --- a/cloud/amazon/ec2_vol.py +++ b/cloud/amazon/ec2_vol.py @@ -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)