diff options
author | Steve Kemp <steve@steve.org.uk> | 2017-03-16 12:16:00 +0200 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2017-03-16 12:16:00 +0200 |
commit | 836f38bfe4a330b9ab1e917139de81771bcb15a8 (patch) | |
tree | 6c9371a2e1cbe269d61b041408c4a4687dfe90c8 /lib | |
parent | 70bd9610a098edf542a63c06d781ec741c8f5aeb (diff) |
Use the subject-prefix if it is present.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/custodian/alerts/mauve.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb index be19eec..0aed390 100644 --- a/lib/custodian/alerts/mauve.rb +++ b/lib/custodian/alerts/mauve.rb @@ -2,6 +2,7 @@ require 'custodian/util/bytemark' require 'custodian/util/dns' +require 'custodian/util/prefix' require 'digest/sha1' @@ -223,12 +224,14 @@ module Custodian # Because there might be N-classes which implemented the test # we need to make sure these are distinct too. # - id_key = test.to_s - id_key += test.class.to_s + id_key = test.to_s + id_key += test.class.to_s + alert.id = Digest::SHA1.hexdigest(id_key) - alert.id = Digest::SHA1.hexdigest(id_key) + # Look for a subject-prefix + subject_prefix = Custodian::Util::Prefix.text() - alert.subject = subject + alert.subject = subject_prefix + subject alert.summary = "The #{test_type} test failed against #{test_host}" # |