diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-03-09 14:43:10 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-03-09 14:43:10 +0000 |
commit | 1165790e7986d920c149afd0898bfc82a34249a5 (patch) | |
tree | 22ec90be31ac77469ce6aa68e9215a5738024c57 /lib/custodian/protocoltest/ping.rb | |
parent | 26f013750196c5028135216de386496696b02a09 (diff) |
Removed trailing whitespace from the code
Diffstat (limited to 'lib/custodian/protocoltest/ping.rb')
-rw-r--r-- | lib/custodian/protocoltest/ping.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/custodian/protocoltest/ping.rb b/lib/custodian/protocoltest/ping.rb index c2c9a04..7622fb5 100644 --- a/lib/custodian/protocoltest/ping.rb +++ b/lib/custodian/protocoltest/ping.rb @@ -41,7 +41,7 @@ module Custodian # # Is this test inverted? # - if line =~ /must\s+not\s+run\s+/ + if line =~ /must\s+not\s+run\s+/ @inverted = true else @inverted = false @@ -71,9 +71,9 @@ module Custodian # binary = nil binary = './bin/multi-ping' - binary = '/usr/bin/multi-ping' if File.exist?('/usr/bin/multi-ping') + binary = '/usr/bin/multi-ping' if File.exist?('/usr/bin/multi-ping') - if binary.nil? + if binary.nil? @error = "Failed to find '/usr/bin/multi-ping'" return false end @@ -85,7 +85,7 @@ module Custodian # # $(/tmp/exploit.sh) must run ping .. # - if @host !~ /^([a-zA-Z0-9:\-\.]+)$/ + if @host !~ /^([a-zA-Z0-9:\-\.]+)$/ @error = "Invalid hostname for ping-test: #{@host}" return false end @@ -109,7 +109,7 @@ module Custodian # begin x = IPAddr.new(@host) - if x.ipv4? or x.ipv6? + if x.ipv4? or x.ipv6? ips.push(@host) end rescue ArgumentError @@ -125,10 +125,10 @@ module Custodian # # Allow the test to disable one/both # - if @line =~ /ipv4_only/ + if @line =~ /ipv4_only/ do_ipv6 = false end - if @line =~ /ipv6_only/ + if @line =~ /ipv6_only/ do_ipv4 = false end @@ -140,11 +140,11 @@ module Custodian timeout(period) do Resolv::DNS.open do |dns| - if do_ipv4 + if do_ipv4 ress = dns.getresources(@host, Resolv::DNS::Resource::IN::A) ress.map { |r| ips.push(r.address.to_s) } end - if do_ipv6 + if do_ipv6 ress = dns.getresources(@host, Resolv::DNS::Resource::IN::AAAA) ress.map { |r| ips.push(r.address.to_s) } end @@ -159,7 +159,7 @@ module Custodian # # Did we fail to perform a DNS lookup? # - if ips.empty? + if ips.empty? @error = "#{@host} failed to resolve to either IPv4 or IPv6" return false end |