From 53e9a422e8ca04908d982d2369e084ed270c2051 Mon Sep 17 00:00:00 2001 From: Rob Szewczyk Date: Fri, 8 Nov 2013 17:46:41 -0500 Subject: [PATCH] Correcting the security group id lookup from the list of security group names --- cloud/ec2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cloud/ec2 b/cloud/ec2 index 09a9a6d1582..5945d930fd4 100644 --- a/cloud/ec2 +++ b/cloud/ec2 @@ -392,9 +392,7 @@ def create_instances(module, ec2): if group_name: grp_details = ec2.get_all_security_groups() if type(group_name) == list: - # FIXME: this should be a nice list comprehension - # also not py 2.4 compliant - group_id = list(filter(lambda grp: str(grp.id) if str(tmp) in str(grp) else None, grp_details) for tmp in group_name) + group_id = [ str(grp.id) for grp in grp_details if str(grp.name) in group_name ] elif type(group_name) == str: for grp in grp_details: if str(group_name) in str(grp):