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
36a305ce
Commit
36a305ce
authored
Dec 06, 2013
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5195 from Multifarious/devel
Fix loading from cache in ec2.py inventory plugin.
parents
a19ef93c
663deff2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
plugins/inventory/ec2.py
+5
-2
No files found.
plugins/inventory/ec2.py
View file @
36a305ce
...
@@ -131,12 +131,15 @@ except ImportError:
...
@@ -131,12 +131,15 @@ except ImportError:
class
Ec2Inventory
(
object
):
class
Ec2Inventory
(
object
):
def
_empty_inventory
(
self
):
return
{
"_meta"
:
{
"hostvars"
:
{}}}
def
__init__
(
self
):
def
__init__
(
self
):
''' Main execution path '''
''' Main execution path '''
# Inventory grouped by instance IDs, tags, security groups, regions,
# Inventory grouped by instance IDs, tags, security groups, regions,
# and availability zones
# and availability zones
self
.
inventory
=
{
"_meta"
:
{
"hostvars"
:
{}}}
self
.
inventory
=
self
.
_empty_inventory
()
# Index of hostname (address) to instance ID
# Index of hostname (address) to instance ID
self
.
index
=
{}
self
.
index
=
{}
...
@@ -157,7 +160,7 @@ class Ec2Inventory(object):
...
@@ -157,7 +160,7 @@ class Ec2Inventory(object):
elif
self
.
args
.
list
:
elif
self
.
args
.
list
:
# Display list of instances for inventory
# Display list of instances for inventory
if
len
(
self
.
inventory
)
==
0
:
if
self
.
inventory
==
self
.
_empty_inventory
()
:
data_to_print
=
self
.
get_inventory_from_cache
()
data_to_print
=
self
.
get_inventory_from_cache
()
else
:
else
:
data_to_print
=
self
.
json_format_dict
(
self
.
inventory
,
True
)
data_to_print
=
self
.
json_format_dict
(
self
.
inventory
,
True
)
...
...
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