mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adds the check for 'not None' also when building host_info dict for ElastiCache clusters, nodes and replication groups
This commit is contained in:
parent
d88a42570e
commit
df77d087a5
1 changed files with 8 additions and 4 deletions
|
@ -1117,10 +1117,14 @@ class Ec2Inventory(object):
|
||||||
|
|
||||||
# Target: Almost everything
|
# Target: Almost everything
|
||||||
elif key == 'ec2_security_groups':
|
elif key == 'ec2_security_groups':
|
||||||
sg_ids = []
|
|
||||||
for sg in value:
|
# Skip if SecurityGroups is None
|
||||||
sg_ids.append(sg['SecurityGroupId'])
|
# (it is possible to have the key defined but no value in it).
|
||||||
host_info["ec2_security_group_ids"] = ','.join([str(i) for i in sg_ids])
|
if value is not None:
|
||||||
|
sg_ids = []
|
||||||
|
for sg in value:
|
||||||
|
sg_ids.append(sg['SecurityGroupId'])
|
||||||
|
host_info["ec2_security_group_ids"] = ','.join([str(i) for i in sg_ids])
|
||||||
|
|
||||||
# Target: Everything
|
# Target: Everything
|
||||||
# Preserve booleans and integers
|
# Preserve booleans and integers
|
||||||
|
|
Loading…
Reference in a new issue