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
1453f7b0
Commit
1453f7b0
authored
Jul 25, 2014
by
James Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #8290.
parent
63bcbd0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
library/cloud/ec2_eip
+17
-5
No files found.
library/cloud/ec2_eip
View file @
1453f7b0
...
@@ -138,11 +138,23 @@ def disassociate_ip_and_instance(ec2, address, instance_id, module):
...
@@ -138,11 +138,23 @@ def disassociate_ip_and_instance(ec2, address, instance_id, module):
def
find_address
(
ec2
,
public_ip
,
module
):
def
find_address
(
ec2
,
public_ip
,
module
):
""" Find an existing Elastic IP address """
""" Find an existing Elastic IP address """
try
:
wait_timeout
=
600
addresses
=
ec2
.
get_all_addresses
([
public_ip
])
wait_timeout
=
time
.
time
()
+
wait_timeout
except
boto
.
exception
.
EC2ResponseError
,
e
:
module
.
fail_json
(
msg
=
str
(
e
.
message
))
while
wait_timeout
>
time
.
time
():
try
:
addresses
=
ec2
.
get_all_addresses
([
public_ip
])
break
except
boto
.
exception
.
EC2ResponseError
,
e
:
if
"Address '
%
s' not found."
%
public_ip
in
e
.
message
:
pass
else
:
module
.
fail_json
(
msg
=
str
(
e
.
message
))
time
.
sleep
(
5
)
if
wait_timeout
<=
time
.
time
():
module
.
fail_json
(
msg
=
"wait for EIPs timeout on
%
s"
%
time
.
asctime
())
return
addresses
[
0
]
return
addresses
[
0
]
...
...
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