mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|compute] work around eventual consistency errors
This commit is contained in:
parent
6ee69750f6
commit
8674833d95
1 changed files with 13 additions and 1 deletions
|
@ -98,7 +98,19 @@ module Fog
|
|||
end
|
||||
|
||||
server.save
|
||||
server.wait_for { ready? }
|
||||
# eventual consistency sometimes means a delay before it appears
|
||||
retries = 3
|
||||
begin
|
||||
server.wait_for { ready? }
|
||||
rescue Fog::Errors::Error => error
|
||||
sleep(1)
|
||||
retries -= 1
|
||||
if retries > 0
|
||||
retry
|
||||
else
|
||||
raise error
|
||||
end
|
||||
end
|
||||
server.setup(:key_data => [server.private_key])
|
||||
server
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue