From e9071c62ba0ba7812cecd91e38b02651b78876f5 Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Sun, 11 Oct 2015 07:07:37 +0530 Subject: [PATCH] Add missing variable initializations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, «ec2: state=stopped instance_ids=…» would fail with a traceback like this: if inst.get_attribute('sourceDestCheck')['sourceDestCheck'] != source_dest_check: NameError: global name 'source_dest_check' is not defined --- lib/ansible/modules/cloud/amazon/ec2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index 2d1c1fc61ba..dee79980d05 100755 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -1223,6 +1223,8 @@ def startstop_instances(module, ec2, instance_ids, state, instance_tags): wait = module.params.get('wait') wait_timeout = int(module.params.get('wait_timeout')) + source_dest_check = module.params.get('source_dest_check') + termination_protection = module.params.get('termination_protection') changed = False instance_dict_array = [] source_dest_check = module.params.get('source_dest_check')