lib/cloud_providers/connections.rb
def ping_port(host, port=22, retry_times=400)
      connected = false
      retry_times.times do |i|
        begin
          break if connected = TCPSocket.new(host, port).is_a?(TCPSocket)
        rescue Exception => e
          sleep(2)
        end
      end
      connected
    end
# hostname or ip to use when running remote commands
hostname or ip to use when running remote commands
hostname or ip to use when running remote commands
def ping_port(host, port=22, retry_times=400)
      connected = false
      retry_times.times do |i|
        begin
          break if connected = TCPSocket.new(host, port).is_a?(TCPSocket)
        rescue Exception => e
          sleep(2)
        end
      end
      connected
    end
def ping_port ( host , port = 22 , retry_times = 400 ) connected = false retry_times . times do | i | begin break if connected = TCPSocket . new ( host , port ) . is_a? ( TCPSocket ) rescue Exception => e sleep ( 2 ) end end connected end
hostname or ip to use when running remote commands
hostname or ip to use when running remote commands
host
port
retry_times