summaryrefslogtreecommitdiff
path: root/lib/custodian/alerts
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-25 22:23:48 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-25 22:23:48 +0000
commit1d06ce6a0da3c78108762b3f4130775a0c5952e7 (patch)
treec33622d651e203cda41096d5413ec42eae9cd900 /lib/custodian/alerts
parent8d59cc01d1b5f1dae91e5010bdb0493434d70a72 (diff)
Use the user-supplied text, if present.
Diffstat (limited to 'lib/custodian/alerts')
-rw-r--r--lib/custodian/alerts/mauve.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb
index 0187aaf..37ed539 100644
--- a/lib/custodian/alerts/mauve.rb
+++ b/lib/custodian/alerts/mauve.rb
@@ -78,6 +78,7 @@ module Custodian
#
update.alert << alert
Mauve::Sender.new( @target ).send(update)
+
end
@@ -110,6 +111,7 @@ module Custodian
#
update.alert << alert
Mauve::Sender.new( @target ).send(update)
+
end
@@ -157,14 +159,28 @@ module Custodian
alert = Mauve::Proto::Alert.new
alert.id = "#{test_type}-#{test_host}"
alert.subject = subject
- alert.summary = "#{test_type}-#{test_host}"
+ alert.summary = "The #{test_type} test failed against #{test_host}"
alert.detail = "<p>The #{test_type} test failed against #{test_host}.</p>"
#
# If we're raising then add the error
#
if ( failure )
- alert.detail = "#{alert.detail}\n#{test.error()}"
+
+ #
+ # The text from the job-defition
+ #
+ user_text = test.get_notification_text()
+
+ #
+ # Add the user-detail if present
+ #
+ alert.detail = "#{alert.detail}<p>#{user_text}</p>" if ( !user_text.nil? )
+
+ #
+ # Add the test-failure message
+ #
+ alert.detail = "#{alert.detail}<p>#{test.error()}</p>"
end
#