summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-09-02 14:54:27 -0400
committerToshio Kuratomi <a.badger@gmail.com>2016-09-08 12:25:02 -0700
commit9653752bcacfe8fb703e9b986387861251404632 (patch)
tree0a78c15759a25ed6ddc88e6dd3266e3ecbdd91d6
parentd2fb8abe393a3d987e2eb327afb6f8402796f590 (diff)
downloadansible-modules-core-9653752bcacfe8fb703e9b986387861251404632.tar.gz
Getting rid of a None type error when no resource tags are defined. (#4638)
-rw-r--r--cloud/amazon/ec2_vpc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloud/amazon/ec2_vpc.py b/cloud/amazon/ec2_vpc.py
index e0575594..6f52d917 100644
--- a/cloud/amazon/ec2_vpc.py
+++ b/cloud/amazon/ec2_vpc.py
@@ -408,7 +408,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:
@@ -444,7 +444,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.