diff --git a/cloud/amazon/ec2_vpc_subnet.py b/cloud/amazon/ec2_vpc_subnet.py index d0cc68e07fa..729357d5020 100644 --- a/cloud/amazon/ec2_vpc_subnet.py +++ b/cloud/amazon/ec2_vpc_subnet.py @@ -122,7 +122,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