1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

make sure I'm getting valid data back.

This commit is contained in:
Nat Welch 2013-06-20 16:23:08 -07:00
parent 60121508b3
commit b4c5766c69

View file

@ -44,8 +44,10 @@ module Fog
def ready?
data = service.get_server(self.name, self.zone_name).body
p data
data['zone_name'] = self.zone_name
self.merge_attributes(data)
self.state == RUNNING_STATE
end
@ -84,7 +86,7 @@ module Fog
end
# Now make sure everything is ok.
ready? && !public_ip_address.nil? && public_key && metadata['sshKeys']
ready? && !public_ip_address.nil? && public_key && metadata['sshKeys'] && !!Timeout::timeout(8) { ssh('pwd', options) }
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
false
end