Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
d88a4257
Commit
d88a4257
authored
Jun 29, 2015
by
Victor Schröder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a check for 'not None' values when iterating ElastiCache SecurityGroups keys
parent
d164c9c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
plugins/inventory/ec2.py
+10
-2
No files found.
plugins/inventory/ec2.py
View file @
d88a4257
...
...
@@ -791,7 +791,11 @@ class Ec2Inventory(object):
# Inventory: Group by security group
if
self
.
group_by_security_group
and
not
is_redis
:
if
'SecurityGroups'
in
cluster
:
# Check for the existance of the 'SecurityGroups' key and also if
# this key has some value. When the cluster is not placed in a SG
# the query can return None here and cause an error.
if
'SecurityGroups'
in
cluster
and
cluster
[
'SecurityGroups'
]
is
not
None
:
for
security_group
in
cluster
[
'SecurityGroups'
]:
key
=
self
.
to_safe
(
"security_group_"
+
security_group
[
'SecurityGroupId'
])
self
.
push
(
self
.
inventory
,
key
,
dest
)
...
...
@@ -879,7 +883,11 @@ class Ec2Inventory(object):
# Inventory: Group by security group
if
self
.
group_by_security_group
:
if
'SecurityGroups'
in
cluster
:
# Check for the existance of the 'SecurityGroups' key and also if
# this key has some value. When the cluster is not placed in a SG
# the query can return None here and cause an error.
if
'SecurityGroups'
in
cluster
and
cluster
[
'SecurityGroups'
]
is
not
None
:
for
security_group
in
cluster
[
'SecurityGroups'
]:
key
=
self
.
to_safe
(
"security_group_"
+
security_group
[
'SecurityGroupId'
])
self
.
push
(
self
.
inventory
,
key
,
dest
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment