mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
fix edge case where boto returns empty list after subnet creation
This commit is contained in:
@@ -121,7 +121,7 @@ def get_subnet_info(subnet):
|
||||
def subnet_exists(vpc_conn, subnet_id):
|
||||
filters = {'subnet-id': subnet_id}
|
||||
subnet = vpc_conn.get_all_subnets(filters=filters)
|
||||
if subnet[0].state == "available":
|
||||
if subnet and subnet[0].state == "available":
|
||||
return subnet[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user