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
13a5993a
Commit
13a5993a
authored
Jul 14, 2014
by
Adam Chainz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation in ec2.py
parent
8a6cfa1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
plugins/inventory/ec2.py
+7
-7
No files found.
plugins/inventory/ec2.py
View file @
13a5993a
...
@@ -240,7 +240,7 @@ class Ec2Inventory(object):
...
@@ -240,7 +240,7 @@ class Ec2Inventory(object):
self
.
cache_path_cache
=
cache_dir
+
"/ansible-ec2.cache"
self
.
cache_path_cache
=
cache_dir
+
"/ansible-ec2.cache"
self
.
cache_path_index
=
cache_dir
+
"/ansible-ec2.index"
self
.
cache_path_index
=
cache_dir
+
"/ansible-ec2.index"
self
.
cache_max_age
=
config
.
getint
(
'ec2'
,
'cache_max_age'
)
self
.
cache_max_age
=
config
.
getint
(
'ec2'
,
'cache_max_age'
)
def
parse_cli_args
(
self
):
def
parse_cli_args
(
self
):
...
@@ -285,12 +285,12 @@ class Ec2Inventory(object):
...
@@ -285,12 +285,12 @@ class Ec2Inventory(object):
if
conn
is
None
:
if
conn
is
None
:
print
(
"region name:
%
s likely not supported, or AWS is down. connection to region failed."
%
region
)
print
(
"region name:
%
s likely not supported, or AWS is down. connection to region failed."
%
region
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
reservations
=
conn
.
get_all_instances
()
reservations
=
conn
.
get_all_instances
()
for
reservation
in
reservations
:
for
reservation
in
reservations
:
for
instance
in
reservation
.
instances
:
for
instance
in
reservation
.
instances
:
self
.
add_instance
(
instance
,
region
)
self
.
add_instance
(
instance
,
region
)
except
boto
.
exception
.
BotoServerError
,
e
:
except
boto
.
exception
.
BotoServerError
,
e
:
if
not
self
.
eucalyptus
:
if
not
self
.
eucalyptus
:
print
"Looks like AWS is down again:"
print
"Looks like AWS is down again:"
...
@@ -298,7 +298,7 @@ class Ec2Inventory(object):
...
@@ -298,7 +298,7 @@ class Ec2Inventory(object):
sys
.
exit
(
1
)
sys
.
exit
(
1
)
def
get_rds_instances_by_region
(
self
,
region
):
def
get_rds_instances_by_region
(
self
,
region
):
''' Makes an AWS API call to the list of RDS instances in a particular
''' Makes an AWS API call to the list of RDS instances in a particular
region '''
region '''
try
:
try
:
...
@@ -368,7 +368,7 @@ class Ec2Inventory(object):
...
@@ -368,7 +368,7 @@ class Ec2Inventory(object):
# Inventory: Group by key pair
# Inventory: Group by key pair
if
instance
.
key_name
:
if
instance
.
key_name
:
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'key_'
+
instance
.
key_name
),
dest
)
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'key_'
+
instance
.
key_name
),
dest
)
# Inventory: Group by security group
# Inventory: Group by security group
try
:
try
:
for
group
in
instance
.
groups
:
for
group
in
instance
.
groups
:
...
@@ -426,10 +426,10 @@ class Ec2Inventory(object):
...
@@ -426,10 +426,10 @@ class Ec2Inventory(object):
# Inventory: Group by availability zone
# Inventory: Group by availability zone
self
.
push
(
self
.
inventory
,
instance
.
availability_zone
,
dest
)
self
.
push
(
self
.
inventory
,
instance
.
availability_zone
,
dest
)
# Inventory: Group by instance type
# Inventory: Group by instance type
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'type_'
+
instance
.
instance_class
),
dest
)
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'type_'
+
instance
.
instance_class
),
dest
)
# Inventory: Group by security group
# Inventory: Group by security group
try
:
try
:
if
instance
.
security_group
:
if
instance
.
security_group
:
...
...
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