mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 22:30:22 -07:00
Getting rid of a None type error when no resource tags are defined. (#4638)
This commit is contained in:
parent
69ec272982
commit
f1db594e9f
1 changed files with 2 additions and 2 deletions
|
@ -406,7 +406,7 @@ def create_vpc(module, vpc_conn):
|
||||||
for subnet in subnets:
|
for subnet in subnets:
|
||||||
add_subnet = True
|
add_subnet = True
|
||||||
subnet_tags_current = True
|
subnet_tags_current = True
|
||||||
new_subnet_tags = subnet.get('resource_tags', None)
|
new_subnet_tags = subnet.get('resource_tags', {})
|
||||||
subnet_tags_delete = []
|
subnet_tags_delete = []
|
||||||
|
|
||||||
for csn in current_subnets:
|
for csn in current_subnets:
|
||||||
|
@ -442,7 +442,7 @@ def create_vpc(module, vpc_conn):
|
||||||
if add_subnet:
|
if add_subnet:
|
||||||
try:
|
try:
|
||||||
new_subnet = vpc_conn.create_subnet(vpc.id, subnet['cidr'], subnet.get('az', None))
|
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:
|
if new_subnet_tags:
|
||||||
# Sometimes AWS takes its time to create a subnet and so using new subnets's id
|
# Sometimes AWS takes its time to create a subnet and so using new subnets's id
|
||||||
# to create tags results in exception.
|
# to create tags results in exception.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue