From a37a84243b968087668a3c2e73b5032b6d3ceeee Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 16 Apr 2014 12:21:32 -0500 Subject: [PATCH] Check resource_tags value before using it in ec2_vpc Fixes #7024 --- library/cloud/ec2_vpc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cloud/ec2_vpc b/library/cloud/ec2_vpc index 44d207b3896..1bd569f478c 100644 --- a/library/cloud/ec2_vpc +++ b/library/cloud/ec2_vpc @@ -237,7 +237,7 @@ def find_vpc(module, vpc_conn, vpc_id=None, cidr=None): vpc_tags = dict((t.name, t.value) for t in vpc_conn.get_all_tags(filters={'resource-id': vpc.id})) # If the supplied list of ID Tags match a subset of the VPC Tags, we found our VPC - if set(resource_tags.items()).issubset(set(vpc_tags.items())): + if resource_tags and set(resource_tags.items()).issubset(set(vpc_tags.items())): found_vpcs.append(vpc) found_vpc = None @@ -309,7 +309,7 @@ def create_vpc(module, vpc_conn): vpc_spec_tags = module.params.get('resource_tags') vpc_tags = dict((t.name, t.value) for t in vpc_conn.get_all_tags(filters={'resource-id': vpc.id})) - if not set(vpc_spec_tags.items()).issubset(set(vpc_tags.items())): + if vpc_spec_tags and not set(vpc_spec_tags.items()).issubset(set(vpc_tags.items())): new_tags = {} for (key, value) in set(vpc_spec_tags.items()):