From a71b1b738512e0472bc745124b9424cac89d4d42 Mon Sep 17 00:00:00 2001 From: Marcus Ahle Date: Mon, 8 Dec 2014 12:55:27 -0500 Subject: [PATCH] Preventing Nonetype is not iterable error when no tags are passed in for a newly created ASG --- lib/ansible/modules/cloud/amazon/ec2_asg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_asg.py b/lib/ansible/modules/cloud/amazon/ec2_asg.py index ff3910ccd1e..c5de2fac07f 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_asg.py +++ b/lib/ansible/modules/cloud/amazon/ec2_asg.py @@ -248,7 +248,7 @@ def get_properties(autoscaling_group): properties['instance_facts'] = instance_facts properties['load_balancers'] = autoscaling_group.load_balancers - if hasattr(autoscaling_group, "tags"): + if getattr(autoscaling_group, "tags", None): properties['tags'] = dict((t.key, t.value) for t in autoscaling_group.tags) return properties