Skip to content

Commit

Permalink
Appease Rubocop
Browse files Browse the repository at this point in the history
Signed-off-by: João Vale <[email protected]>
  • Loading branch information
jvale committed Feb 11, 2018
1 parent 7255558 commit c58810d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resources/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ class LinuxHostProvider < UnixHostProvider
def missing_requirements(protocol)
missing = []

if protocol == 'tcp' or protocol == 'udp'
if %w{tcp udp}.include?(protocol)
missing << 'timeout (part of coreutils) must be installed' unless inspec.command('timeout').exist?
end

missing
end

def ping(hostname, port, protocol)
if protocol == 'tcp' or protocol == "udp"
if %w{tcp udp}.include?(protocol)
resp = inspec.command("timeout 1 bash -c \"< /dev/#{protocol}/#{hostname}/#{port}\"")
else
# fall back to ping, but we can only test ICMP packages with ping
Expand Down

0 comments on commit c58810d

Please sign in to comment.