diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-25 22:23:48 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-25 22:23:48 +0000 |
commit | f0453179899e9cb094901d6686571d6d9727bd39 (patch) | |
tree | b2d3bdeeb05d21e3ecf6f984bf3fcaa68000c8dc | |
parent | e8c817c496a913dd2c9bd73073620a91c62646b4 (diff) |
Use the user-supplied text, if present.
-rw-r--r-- | lib/custodian/alerts/mauve.rb | 20 |
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 # |