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
|
||||
|
||||
# wait for aws to be ready
|
||||
wait_for { sshable? }
|
||||
wait_for { sshable?(credentials) }
|
||||
|
||||
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
|
||||
end
|
||||
|
|
|
@ -62,8 +62,8 @@ module Fog
|
|||
22
|
||||
end
|
||||
|
||||
def sshable?
|
||||
ready? && !public_ip_address.nil? && !!Timeout::timeout(8) { ssh 'pwd' }
|
||||
def sshable?(options={})
|
||||
ready? && !public_ip_address.nil? && !!Timeout::timeout(8) { ssh('pwd', options) }
|
||||
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
|
||||
false
|
||||
end
|
||||
|
|
|
@ -87,13 +87,13 @@ module Fog
|
|||
commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys}
|
||||
end
|
||||
|
||||
# wait for aws to be ready
|
||||
wait_for { sshable? }
|
||||
|
||||
if credentials[:password].nil? && !rootpassword.nil?
|
||||
credentials[:password] = rootpassword
|
||||
end
|
||||
|
||||
# wait for glesys to be ready
|
||||
wait_for { sshable?(credentials) }
|
||||
|
||||
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue