summaryrefslogtreecommitdiff
path: root/lib/custodian/util/ping.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2016-04-22 21:48:59 +0300
committerSteve Kemp <steve@steve.org.uk>2016-04-22 21:48:59 +0300
commit67fbf68705e1808107e8cea1d3ab6ad0e206f645 (patch)
treee9488cc105876485822be15c29c97ee66bd964ca /lib/custodian/util/ping.rb
parent12de7cf1aefcd5d567a9e6e2eaa061f2074c8dbb (diff)
Fixed up more rubocop warnings.
Again these were whitespace-related.
Diffstat (limited to 'lib/custodian/util/ping.rb')
-rw-r--r--lib/custodian/util/ping.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/custodian/util/ping.rb b/lib/custodian/util/ping.rb
index d563722..21836ac 100644
--- a/lib/custodian/util/ping.rb
+++ b/lib/custodian/util/ping.rb
@@ -26,8 +26,8 @@ module Custodian
#
def initialize(hostname)
- raise ArgumentError, 'Hostname must not be nil' if hostname.nil?
- raise ArgumentError, 'Hostname must be a String' unless hostname.kind_of?(String)
+ raise ArgumentError, 'Hostname must not be nil' if hostname.nil?
+ raise ArgumentError, 'Hostname must be a String' unless hostname.kind_of?(String)
@hostname = hostname
@resolved = Custodian::Util::DNS.hostname_to_ip(hostname)
@@ -45,7 +45,7 @@ module Custodian
# Does the hostname resolve to an IPv4 address?
#
def is_ipv4?
- if (! @resolved.nil?) && (@resolved =~ /^([0-9]+).([0-9]+).([0-9]+).([0-9]+)$/)
+ if (! @resolved.nil?) && (@resolved =~ /^([0-9]+).([0-9]+).([0-9]+).([0-9]+)$/)
true
else
false
@@ -57,7 +57,7 @@ module Custodian
# Does the hostname resolve to an IPv6 address?
#
def is_ipv6?
- if (! @resolved.nil?) && (@resolved =~ /^([a-f0-9:]+)$/i)
+ if (! @resolved.nil?) && (@resolved =~ /^([a-f0-9:]+)$/i)
true
else
false
@@ -72,7 +72,7 @@ module Custodian
# Return false on error.
#
def run_ping
- if is_ipv6?
+ if is_ipv6?
if (system("ping6 -c 1 #{@resolved} 2>/dev/null >/dev/null") == true)
return true
end