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