diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-03-22 17:39:26 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-03-22 17:39:26 +0000 |
commit | 499c144b8cfd973d3766fd81a4e702aa0013de0e (patch) | |
tree | c5603e9272331b74c51ac1afde3b65faaebd56e7 /lib/mauve/alert.rb | |
parent | 24554e44478fadb3c86dea76773d456c5284596d (diff) |
Update to alert to clear cached IPs for the alert subject when it changes.
Diffstat (limited to 'lib/mauve/alert.rb')
-rw-r--r-- | lib/mauve/alert.rb | 11 |
1 files changed, 6 insertions, 5 deletions
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 |