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
1328ecec
Commit
1328ecec
authored
Aug 08, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8416 from willthames/ec2_handle_terminated_instances
Improved handling of already terminated instances
parents
d777f51f
cc59760a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
library/cloud/ec2
+9
-0
No files found.
library/cloud/ec2
View file @
1328ecec
...
@@ -918,6 +918,15 @@ def create_instances(module, ec2, override_count=None):
...
@@ -918,6 +918,15 @@ def create_instances(module, ec2, override_count=None):
except
boto
.
exception
.
BotoServerError
,
e
:
except
boto
.
exception
.
BotoServerError
,
e
:
module
.
fail_json
(
msg
=
"Instance creation failed =>
%
s:
%
s"
%
(
e
.
error_code
,
e
.
error_message
))
module
.
fail_json
(
msg
=
"Instance creation failed =>
%
s:
%
s"
%
(
e
.
error_code
,
e
.
error_message
))
# The instances returned through run_instances can be in
# terminated state due to idempotency.
terminated_instances
=
[
str
(
instance
.
id
)
for
instance
in
res
.
instances
if
instance
.
state
==
'terminated'
]
if
terminated_instances
:
module
.
fail_json
(
msg
=
"Instances with id(s)
%
s "
%
terminated_instances
+
"were created previously but have since been terminated - "
+
"use a (possibly different) 'instanceid' parameter"
)
# wait here until the instances are up
# wait here until the instances are up
num_running
=
0
num_running
=
0
wait_timeout
=
time
.
time
()
+
wait_timeout
wait_timeout
=
time
.
time
()
+
wait_timeout
...
...
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