Module: Capistrano::ASG::Rolling::SSH
- Defined in:
- lib/capistrano/asg/rolling/ssh.rb
Overview
SSH availability test.
Class Method Summary collapse
Class Method Details
.test?(ip_address, user, ssh_options) ⇒ Boolean
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/capistrano/asg/rolling/ssh.rb', line 10 def test?(ip_address, user, ) = || {} [:timeout] = 10 ::Net::SSH.start(ip_address, user, ) do |ssh| ssh.exec!('echo hello') end true rescue ::Net::SSH::ConnectionTimeout, ::Net::SSH::Proxy::ConnectError, Errno::ECONNREFUSED, Errno::ETIMEDOUT false end |