mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Updated setup method to retry once on disconnect to try to address issues with Ubuntu 12.04 images.
This commit is contained in:
parent
742175ea29
commit
ec6f12fb1e
1 changed files with 10 additions and 0 deletions
|
@ -570,6 +570,8 @@ module Fog
|
||||||
def setup(credentials = {})
|
def setup(credentials = {})
|
||||||
requires :ssh_ip_address, :identity, :public_key, :username
|
requires :ssh_ip_address, :identity, :public_key, :username
|
||||||
|
|
||||||
|
retried_disconnect = false
|
||||||
|
|
||||||
commands = [
|
commands = [
|
||||||
%{mkdir .ssh},
|
%{mkdir .ssh},
|
||||||
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
|
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
|
||||||
|
@ -585,6 +587,14 @@ module Fog
|
||||||
rescue Errno::ECONNREFUSED
|
rescue Errno::ECONNREFUSED
|
||||||
sleep(1)
|
sleep(1)
|
||||||
retry
|
retry
|
||||||
|
# Ubuntu 12.04 images seem to be disconnecting during the ssh setup process.
|
||||||
|
# This rescue block is an effort to address that issue.
|
||||||
|
rescue Net::SSH::Disconnect
|
||||||
|
unless retried_disconnect
|
||||||
|
retried_disconnect = true
|
||||||
|
sleep(1)
|
||||||
|
retry
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def virtual_interfaces
|
def virtual_interfaces
|
||||||
|
|
Loading…
Add table
Reference in a new issue