diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-26 16:02:00 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-26 16:02:00 +0000 |
commit | c61f9735c8b5be297c6114d8f2067adf42566b9e (patch) | |
tree | 928cb6e6a0aabe68b1567469103aadf6b07f6139 /lib/custodian/settings.rb | |
parent | ab883e6a1a17c014cd283d2a96d7a978d2330499 (diff) |
Updated so that each alert-type has its dedicated alert-target.
Diffstat (limited to 'lib/custodian/settings.rb')
-rw-r--r-- | lib/custodian/settings.rb | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/custodian/settings.rb b/lib/custodian/settings.rb index 48adcc0..b601d79 100644 --- a/lib/custodian/settings.rb +++ b/lib/custodian/settings.rb @@ -54,6 +54,7 @@ module Custodian val = $2.dup key.strip! val.strip! + @settings[key] = val end end @@ -125,24 +126,31 @@ module Custodian # # When the alerter is "mauve" the target is the destination for the alerts. # - def alerter_target + def alerter_target( alert ) _load() unless( _loaded? ) + + # + # Find the alerting method. + # # if we have something setup then use it. - if ( @settings['alerter_target'] ) - return( @settings['alerter_target'] ) + if ( @settings["#{alert}_target"] ) + return( @settings["#{alert}_target"] ) + else end # otherwise per-test defaults. - case alerter() - when "smtp": + case alert + when "smtp": "root" - when "mauve": + when "mauve": "alert.bytemark.co.uk" - when "file": + when "file": "alerts.log" - else - nil + when "redis": + "127.0.0.1:6379" + else + nil end end |