From 836f38bfe4a330b9ab1e917139de81771bcb15a8 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 16 Mar 2017 12:16:00 +0200 Subject: Use the subject-prefix if it is present. --- lib/custodian/alerts/mauve.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/custodian') 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}" # -- cgit v1.2.1