1
0
Fork 0
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:
geemus 2010-12-03 11:37:11 -08:00
parent 6ee69750f6
commit 8674833d95

View file

@ -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