From 7c8f0b99af57139ab20cc3292219afa5c39e0a50 Mon Sep 17 00:00:00 2001 From: Kale Franz Date: Wed, 17 Dec 2014 09:01:50 -0800 Subject: [PATCH] #531 correction correct list comprehension for older versions of python (back to python 2.4) --- lib/ansible/modules/cloud/amazon/ec2_group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_group.py b/lib/ansible/modules/cloud/amazon/ec2_group.py index edecc72ce34..59623e96d64 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_group.py +++ b/lib/ansible/modules/cloud/amazon/ec2_group.py @@ -117,9 +117,9 @@ except ImportError: def make_rule_key(prefix, rule, group_id, cidr_ip): """Creates a unique key for an individual group rule""" if isinstance(rule, dict): - proto, from_port, to_port = (rule.get(x, None) for x in ('proto', 'from_port', 'to_port')) + proto, from_port, to_port = [rule.get(x, None) for x in ('proto', 'from_port', 'to_port')] else: # isinstance boto.ec2.securitygroup.IPPermissions - proto, from_port, to_port = (getattr(rule, x, None) for x in ('ip_protocol', 'from_port', 'to_port')) + proto, from_port, to_port = [getattr(rule, x, None) for x in ('ip_protocol', 'from_port', 'to_port')] key = "%s-%s-%s-%s-%s-%s" % (prefix, proto, from_port, to_port, group_id, cidr_ip) return key.lower().replace('-none', '-None')