From f0453179899e9cb094901d6686571d6d9727bd39 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Sun, 25 Nov 2012 22:23:48 +0000 Subject: Use the user-supplied text, if present. --- lib/custodian/alerts/mauve.rb | 20 ++++++++++++++++++-- 1 file 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 = "

The #{test_type} test failed against #{test_host}.

" # # 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}

#{user_text}

" if ( !user_text.nil? ) + + # + # Add the test-failure message + # + alert.detail = "#{alert.detail}

#{test.error()}

" end # -- cgit v1.2.1