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

custome sshable

This commit is contained in:
Nat Welch 2013-04-30 18:35:02 -07:00
parent 1220c8989b
commit 8e184aedd2
2 changed files with 9 additions and 0 deletions

View file

@ -66,6 +66,14 @@ module Fog
sleep(1)
retry
end
def sshable?(options={})
service.set_metadata(self.instance, self.zone, {'sshKeys' => self.public_key })
ready? && !public_ip_address.nil? && public_key && metadata['sshKeys']
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
false
end
end
end
end

View file

@ -8,6 +8,7 @@ Shindo.tests("Fog::Compute[:google] | server model", ['google']) do
end
test('#sshable?') do
@instance.wait_for { sshable? }
@instance.sshable?
end