summaryrefslogtreecommitdiff
path: root/lib/custodian/alerts
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:09:46 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:09:46 +0000
commitedf0e675123e4869e2739d1bab0ed57b3b9f664c (patch)
treec0771fecb0734fb342cf16e352f19fd3ead9a112 /lib/custodian/alerts
parent22b40326730fb7a4a8e2f5cb8d877f6a84494d02 (diff)
Do not use parentheses for method calls with no arguments.
This is neater. Flagged by rubocop
Diffstat (limited to 'lib/custodian/alerts')
-rw-r--r--lib/custodian/alerts/file.rb2
-rw-r--r--lib/custodian/alerts/graphite.rb4
-rw-r--r--lib/custodian/alerts/mauve.rb8
-rw-r--r--lib/custodian/alerts/redis-state.rb2
-rw-r--r--lib/custodian/alerts/smtp.rb4
5 files changed, 10 insertions, 10 deletions
diff --git a/lib/custodian/alerts/file.rb b/lib/custodian/alerts/file.rb
index cc2a672..5874136 100644
--- a/lib/custodian/alerts/file.rb
+++ b/lib/custodian/alerts/file.rb
@@ -31,7 +31,7 @@ module Custodian
# Record a raise event for the given test.
#
def raise
- write_message( "RAISE: #{test.target} failed #{test.get_type}-test - #{test.error()}" )
+ write_message( "RAISE: #{test.target} failed #{test.get_type}-test - #{test.error}" )
end
diff --git a/lib/custodian/alerts/graphite.rb b/lib/custodian/alerts/graphite.rb
index 34ec73c..2e49125 100644
--- a/lib/custodian/alerts/graphite.rb
+++ b/lib/custodian/alerts/graphite.rb
@@ -63,9 +63,9 @@ module Custodian
#
# Send via UDP.
#
- socket = UDPSocket.new()
+ socket = UDPSocket.new
socket.send( payload, 0, @target, 2003 );
- socket.close()
+ socket.close
end
diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb
index 8ce14c1..dfa4a04 100644
--- a/lib/custodian/alerts/mauve.rb
+++ b/lib/custodian/alerts/mauve.rb
@@ -69,7 +69,7 @@ module Custodian
#
update = Mauve::Proto::AlertUpdate.new
update.alert = []
- update.source = @settings.alert_source()
+ update.source = @settings.alert_source
update.replace = false
#
@@ -151,7 +151,7 @@ module Custodian
#
update = Mauve::Proto::AlertUpdate.new
update.alert = []
- update.source = @settings.alert_source()
+ update.source = @settings.alert_source
update.replace = false
#
@@ -241,7 +241,7 @@ module Custodian
#
# The text from the job-defition
#
- user_text = test.get_notification_text()
+ user_text = test.get_notification_text
#
# Add the user-detail if present
@@ -251,7 +251,7 @@ module Custodian
#
# Add the test-failure message
#
- alert.detail = "#{alert.detail}<p>#{test.error()}</p>"
+ alert.detail = "#{alert.detail}<p>#{test.error}</p>"
#
# Determine if this is inside/outside the bytemark network
diff --git a/lib/custodian/alerts/redis-state.rb b/lib/custodian/alerts/redis-state.rb
index 7d9daa7..f37cef2 100644
--- a/lib/custodian/alerts/redis-state.rb
+++ b/lib/custodian/alerts/redis-state.rb
@@ -59,7 +59,7 @@ module Custodian
tmp["type"] = @test.get_type
tmp["target"] = @test.target
tmp["result"] = "RAISE"
- tmp["reason"] = @test.error()
+ tmp["reason"] = @test.error
tmp["test" ] = @test.to_s
tmp["class" ] = @test.class
diff --git a/lib/custodian/alerts/smtp.rb b/lib/custodian/alerts/smtp.rb
index 4de6fbe..d37701b 100644
--- a/lib/custodian/alerts/smtp.rb
+++ b/lib/custodian/alerts/smtp.rb
@@ -30,8 +30,8 @@ module Custodian
# Raise an alert by email.
#
def raise
- subject = "#{test.target} alert #{test.get_type}-test - #{test.error()}"
- body = "The alert has raised, with the following details:\n#{test.error()}\nRegards\n";
+ subject = "#{test.target} alert #{test.get_type}-test - #{test.error}"
+ body = "The alert has raised, with the following details:\n#{test.error}\nRegards\n";
_send_mail( @target, subject, body )
end