mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1635 from anshul/master
sshable should accept the same options as ssh
This commit is contained in:
commit
82dad5103e
3 changed files with 6 additions and 6 deletions
|
@ -202,7 +202,7 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
# wait for aws to be ready
|
# wait for aws to be ready
|
||||||
wait_for { sshable? }
|
wait_for { sshable?(credentials) }
|
||||||
|
|
||||||
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
|
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
|
||||||
end
|
end
|
||||||
|
|
|
@ -62,8 +62,8 @@ module Fog
|
||||||
22
|
22
|
||||||
end
|
end
|
||||||
|
|
||||||
def sshable?
|
def sshable?(options={})
|
||||||
ready? && !public_ip_address.nil? && !!Timeout::timeout(8) { ssh 'pwd' }
|
ready? && !public_ip_address.nil? && !!Timeout::timeout(8) { ssh('pwd', options) }
|
||||||
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
|
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
|
@ -87,13 +87,13 @@ module Fog
|
||||||
commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys}
|
commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys}
|
||||||
end
|
end
|
||||||
|
|
||||||
# wait for aws to be ready
|
|
||||||
wait_for { sshable? }
|
|
||||||
|
|
||||||
if credentials[:password].nil? && !rootpassword.nil?
|
if credentials[:password].nil? && !rootpassword.nil?
|
||||||
credentials[:password] = rootpassword
|
credentials[:password] = rootpassword
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# wait for glesys to be ready
|
||||||
|
wait_for { sshable?(credentials) }
|
||||||
|
|
||||||
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
|
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue