From cc35e80a54b81f9a3e1b1fd86cbf482633a5b605 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Thu, 13 Feb 2014 19:51:33 +1000 Subject: [PATCH] ec2 module fails when state is not absent tagged_instances is initialised in a scope not visible when state is not absent. --- cloud/ec2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/ec2 b/cloud/ec2 index c9d721f0e43..1b22496c8eb 100644 --- a/cloud/ec2 +++ b/cloud/ec2 @@ -1045,6 +1045,7 @@ def main(): ec2 = ec2_connect(module) + tagged_instances = [] if module.params.get('state') == 'absent': instance_ids = module.params.get('instance_ids') if not isinstance(instance_ids, list): @@ -1064,7 +1065,6 @@ def main(): if not module.params.get('image'): module.fail_json(msg='image parameter is required for new instance') - tagged_instances = [] if module.params.get('exact_count'): (tagged_instances, instance_dict_array, new_instance_ids, changed) = enforce_count(module, ec2) else: