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
f4db6d1a
Commit
f4db6d1a
authored
Jun 07, 2013
by
jclaybaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed whitespace and added a comment to explain if statement
parent
4733dc6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
plugins/inventory/ec2.py
+7
-5
No files found.
plugins/inventory/ec2.py
View file @
f4db6d1a
...
@@ -245,9 +245,10 @@ class Ec2Inventory(object):
...
@@ -245,9 +245,10 @@ class Ec2Inventory(object):
else
:
else
:
conn
=
ec2
.
connect_to_region
(
region
)
conn
=
ec2
.
connect_to_region
(
region
)
if
conn
is
None
:
# connect_to_region will fail "silently" by returning None if the region name is wrong or not supported
print
(
"AWS is down or region name:
%
s likely not supported. connection to region failed."
%
region
)
if
conn
is
None
:
sys
.
exit
(
1
)
print
(
"region name:
%
s likely not supported, or AWS is down. connection to region failed."
%
region
)
sys
.
exit
(
1
)
reservations
=
conn
.
get_all_instances
()
reservations
=
conn
.
get_all_instances
()
for
reservation
in
reservations
:
for
reservation
in
reservations
:
...
@@ -283,9 +284,10 @@ class Ec2Inventory(object):
...
@@ -283,9 +284,10 @@ class Ec2Inventory(object):
else
:
else
:
conn
=
ec2
.
connect_to_region
(
region
)
conn
=
ec2
.
connect_to_region
(
region
)
# connect_to_region will fail "silently" by returning None if the region name is wrong or not supported
if
conn
is
None
:
if
conn
is
None
:
print
(
"AWS is down or region name:
%
s likely not supported
. 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
([
instance_id
])
reservations
=
conn
.
get_all_instances
([
instance_id
])
for
reservation
in
reservations
:
for
reservation
in
reservations
:
...
...
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