summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/mx.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:10:32 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:10:32 +0000
commit1ce0906b3480702085d4596dbb4758c115ab298f (patch)
tree695cd365c2ff73904328a049f3b9cfcc5a0a1abd /lib/custodian/protocoltest/mx.rb
parent891b720013f06f092f6be82adad95e5551c696b6 (diff)
Don't use parenthesis aroudn conditions in an if.
Diffstat (limited to 'lib/custodian/protocoltest/mx.rb')
-rw-r--r--lib/custodian/protocoltest/mx.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/custodian/protocoltest/mx.rb b/lib/custodian/protocoltest/mx.rb
index 2372556..b77e596 100644
--- a/lib/custodian/protocoltest/mx.rb
+++ b/lib/custodian/protocoltest/mx.rb
@@ -28,7 +28,7 @@ module Custodian
# The main domain we're querying
@host = line.split(/\s+/)[0]
- if ( line =~ /must\s+not\s+run\s+/ )
+ if line =~ /must\s+not\s+run\s+/
@inverted = true
else
@inverted = false
@@ -90,7 +90,7 @@ module Custodian
#
# So on that basis we must alert.
#
- if ( mx.empty? ) then
+ if mx.empty? then
@error = "Failed to perform DNS lookup of MX record(s) for host #{@host}"
return false
end
@@ -114,12 +114,12 @@ module Custodian
read = socket.sysread(1024)
# trim to a sane length & strip newlines.
- if ( ! read.nil? )
+ if ! read.nil?
read = read[0,255]
read.gsub!(/[\n\r]/, "")
end
- if ( read =~ /^220/ )
+ if read =~ /^220/
passed += 1
else
failed += 1
@@ -140,7 +140,7 @@ module Custodian
#
# At this point we should have tested the things
#
- if ( failed > 0 )
+ if failed > 0
@error = "There are #{mx.size} hosts running as MX-servers for domain #{@host} - #{passed}:OK #{failed}:FAILED - #{error}"
return false
else