summaryrefslogtreecommitdiff
path: root/lib/custodian/settings.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-26 16:02:00 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-26 16:02:00 +0000
commit19087662065bd48aa50d8e5acb1416e002dde393 (patch)
tree7a3abfe0f11d23ee4802e05fb5f783c02ba0ef2f /lib/custodian/settings.rb
parentb37c5109ba4a25fa61bdb0a90b4e72f93f78c35f (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.rb26
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