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
d6b912c4
Commit
d6b912c4
authored
Feb 26, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifying the wait logic for newly created images to avoid tracebacks
Fixes #4619
parent
a37a6983
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
library/cloud/ec2_ami
+4
-5
No files found.
library/cloud/ec2_ami
View file @
d6b912c4
...
...
@@ -199,17 +199,17 @@ def create_image(module, ec2):
# Wait until the image is recognized. EC2 API has eventual consistency,
# such that a successful CreateImage API call doesn't guarantee the success
# of subsequent DescribeImages API call using the new image id returned.
for
i
in
range
(
30
):
for
i
in
range
(
wait_timeout
):
try
:
img
=
ec2
.
get_image
(
image_id
)
break
except
boto
.
exception
.
EC2ResponseError
,
e
:
if
e
.
error_code
==
'InvalidAMIID.NotFound'
:
if
'InvalidAMIID.NotFound'
in
e
.
error_code
and
wait
:
time
.
sleep
(
1
)
else
:
raise
module
.
fail_json
(
msg
=
"Error while trying to find the new image. Using wait=yes and/or a longer wait_timeout may help."
)
else
:
module
.
fail_json
(
msg
=
"timed out waiting for image to be recognized"
)
module
.
fail_json
(
msg
=
"timed out waiting for image to be recognized"
)
# wait here until the image is created
wait_timeout
=
time
.
time
()
+
wait_timeout
...
...
@@ -221,7 +221,6 @@ def create_image(module, ec2):
module
.
fail_json
(
msg
=
"timed out waiting for image to be created"
)
module
.
exit_json
(
msg
=
"AMI creation operation complete"
,
image_id
=
image_id
,
state
=
img
.
state
,
changed
=
True
)
sys
.
exit
(
0
)
def
deregister_image
(
module
,
ec2
):
...
...
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