Module: check_mk
Branch: master
Commit: 56920752518ea123eeef39344f4489aeaed9da53
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=56920752518ea1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 20 12:13:57 2014 +0200
FIX notification: fixed exception when sending notifications as sms / ascii mail
Flexible notification plugins with configurable parameters did not work if
the parameters were configured as list of strings.
This exception happened on notications send by ASCII mails and sms.
---
.werks/918 | 10 ++++++++++
ChangeLog | 1 +
modules/notify.py | 10 +++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/918 b/.werks/918
new file mode 100644
index 0000000..491087e
--- /dev/null
+++ b/.werks/918
@@ -0,0 +1,10 @@
+Title: notification: fixed exception when sending notifications as sms / ascii mail
+Level: 2
+Component: notifications
+Version: 1.2.5i3
+Date: 1400580654
+Class: fix
+
+Flexible notification plugins with configurable parameters did not work if
+the parameters were configured as list of strings.
+This exception happened on notications send by ASCII mails and sms.
diff --git a/ChangeLog b/ChangeLog
index 029b577..94d0d05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -109,6 +109,7 @@
* 0753 FIX: FIX: correctly show original state in HTML notification mails...
* 0609 FIX: mail notification script now uses 6 digit hex codes for colors to be
better compatible with web based mail browsers
* 0964 FIX: Fix hanging shutdown of CMC on RedHat 5.X...
+ * 0918 FIX: notification: fixed exception when sending notifications as sms / ascii
mail...
Reporting & Availability:
* 0756 Allow availability of multisite BI aggregates at once...
diff --git a/modules/notify.py b/modules/notify.py
index 4ab982b..3e08ec4 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -513,9 +513,13 @@ def notify_rulebased(raw_context, analyse=False):
return analysis_info
def rbn_finalize_plugin_parameters(hostname, plugin, rule_parameters):
- parameters = host_extra_conf_merged(hostname, notification_parameters.get(plugin,
[]))
- parameters.update(rule_parameters)
- return parameters
+ # Right now we are only able to finalize notification plugins with dict parameters..
+ if type(rule_parameters) == dict:
+ parameters = host_extra_conf_merged(hostname, notification_parameters.get(plugin,
[]))
+ parameters.update(rule_parameters)
+ return parameters
+ else:
+ return rule_parameters
def add_rulebased_macros(raw_context):
# For the rule based notifications we need the list of contacts