mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #4862 from rob-szew/devel
Correcting the security group id lookup from the list of security group ...
This commit is contained in:
commit
3e6369e026
1 changed files with 1 additions and 3 deletions
|
@ -392,9 +392,7 @@ def create_instances(module, ec2):
|
||||||
if group_name:
|
if group_name:
|
||||||
grp_details = ec2.get_all_security_groups()
|
grp_details = ec2.get_all_security_groups()
|
||||||
if type(group_name) == list:
|
if type(group_name) == list:
|
||||||
# FIXME: this should be a nice list comprehension
|
group_id = [ str(grp.id) for grp in grp_details if str(grp.name) in group_name ]
|
||||||
# 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)
|
|
||||||
elif type(group_name) == str:
|
elif type(group_name) == str:
|
||||||
for grp in grp_details:
|
for grp in grp_details:
|
||||||
if str(group_name) in str(grp):
|
if str(group_name) in str(grp):
|
||||||
|
|
Loading…
Reference in a new issue