From f1db594e9fb32aaa0e41af16593294583fde8293 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 2 Sep 2016 14:54:27 -0400 Subject: [PATCH] Getting rid of a None type error when no resource tags are defined. (#4638) --- lib/ansible/modules/cloud/amazon/ec2_vpc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc.py b/lib/ansible/modules/cloud/amazon/ec2_vpc.py index 58fbaf177a..f7a3035c5d 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc.py @@ -406,7 +406,7 @@ def create_vpc(module, vpc_conn): for subnet in subnets: add_subnet = True subnet_tags_current = True - new_subnet_tags = subnet.get('resource_tags', None) + new_subnet_tags = subnet.get('resource_tags', {}) subnet_tags_delete = [] for csn in current_subnets: @@ -442,7 +442,7 @@ def create_vpc(module, vpc_conn): if add_subnet: try: new_subnet = vpc_conn.create_subnet(vpc.id, subnet['cidr'], subnet.get('az', None)) - new_subnet_tags = subnet.get('resource_tags', None) + new_subnet_tags = subnet.get('resource_tags', {}) if new_subnet_tags: # Sometimes AWS takes its time to create a subnet and so using new subnets's id # to create tags results in exception.