From 499c144b8cfd973d3766fd81a4e702aa0013de0e Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Thu, 22 Mar 2012 17:39:26 +0000 Subject: Update to alert to clear cached IPs for the alert subject when it changes. --- lib/mauve/alert.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/mauve/alert.rb') diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb index edaa2ad..9d6ab85 100644 --- a/lib/mauve/alert.rb +++ b/lib/mauve/alert.rb @@ -199,7 +199,7 @@ module Mauve when IPAddr begin l.include?(IPAddr.new(host)) - rescue ArgumentError + rescue ArgumentError => err # rescue random IPAddr argument errors false end @@ -258,32 +258,33 @@ module Mauve # Set the subject -- this clears the cached_alert_group. # def subject=(s) - attribute_set(:subject, s) self.cached_alert_group = nil + @subject_ips = nil + attribute_set(:subject, s) end # # Set the detail -- this clears the cached_alert_group. # def detail=(s) - attribute_set(:detail, s) self.cached_alert_group = nil + attribute_set(:detail, s) end # # Set the source -- this clears the cached_alert_group. # def source=(s) - attribute_set(:source, s) self.cached_alert_group = nil + attribute_set(:source, s) end # # Set the summary -- this clears the cached_alert_group. # def summary=(s) - attribute_set(:summary, s) self.cached_alert_group = nil + attribute_set(:summary, s) end protected -- cgit v1.2.1