mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
sshable? shouldn't just die
This commit is contained in:
parent
a39e976a57
commit
99fac66767
2 changed files with 2 additions and 3 deletions
|
@ -105,7 +105,6 @@ module Fog
|
|||
|
||||
def build_result(api_method, parameters, body_object=nil)
|
||||
if body_object
|
||||
#p api_method, parameters
|
||||
result = @client.execute(
|
||||
:api_method => api_method,
|
||||
:parameters => parameters,
|
||||
|
|
|
@ -86,13 +86,13 @@ module Fog
|
|||
|
||||
def sshable?(options={})
|
||||
# Then check if we have ssh keys set up.
|
||||
if not metadata['sshKeys']
|
||||
if ready? and not metadata['sshKeys']
|
||||
setup
|
||||
end
|
||||
|
||||
# Now make sure everything is ok.
|
||||
ready? && !public_ip_address.nil? && public_key && metadata['sshKeys'] && !!Timeout::timeout(8) { ssh('pwd', options) }
|
||||
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
|
||||
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error, ArgumentError
|
||||
false
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue