Class: Specinfra::Command::Solaris::V10::Host

Inherits:
Base::Host show all
Defined in:
lib/specinfra/command/solaris/v10/host.rb

Class Method Summary collapse

Methods inherited from Base::Host

check_is_resolvable, get_ipaddress, get_ipv4_address, get_ipv6_address

Methods inherited from Base

create, escape

Class Method Details

.check_is_reachable(host, port, proto, timeout) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/specinfra/command/solaris/v10/host.rb', line 3

def check_is_reachable(host, port, proto, timeout)
  if port.nil?
    "ping -n #{escape(host)} #{escape(timeout)}"
  elsif proto == 'tcp'
    "echo 'quit' | mconnect -p #{escape(port)} #{escape(host)} > /dev/null 2>&1"
  else
    raise NotImplementedError.new
  end
end