Module: check_mk
Branch: master
Commit: 8981c1597ea087e9cb8082ac84016e7d44316463
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8981c1597ea087…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jun 20 15:51:24 2014 +0200
FIX Fix crash when debugging notifications with non-Ascii characters
When full notification debugging was enabled then notifications with
a non-Ascii character would raise an exception and not be sent.
---
.werks/1002 | 9 +++++++++
ChangeLog | 3 +++
modules/notify.py | 4 +++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/1002 b/.werks/1002
new file mode 100644
index 0000000..e77ad04
--- /dev/null
+++ b/.werks/1002
@@ -0,0 +1,9 @@
+Title: Fix crash when debugging notifications with non-Ascii characters
+Level: 2
+Component: notifications
+Version: 1.2.5i4
+Date: 1403272237
+Class: fix
+
+When full notification debugging was enabled then notifications with
+a non-Ascii character would raise an exception and not be sent.
diff --git a/ChangeLog b/ChangeLog
index c0fcce9..3f83ad6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,9 @@
* 0935 FIX: CPU utilization: increased maximum value to 10000...
* 0821 FIX: Reducing size of auth.php (needed for authorisation in NagVis) in large
environments...
+ Notifications:
+ * 1002 FIX: Fix crash when debugging notifications with non-Ascii characters...
+
Reporting & Availability:
* 0985 Availability: display phases of freqent state changes as "chaos"...
diff --git a/modules/notify.py b/modules/notify.py
index 53fe4df..d29808a 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -205,8 +205,10 @@ def notify_notify(raw_context, analyse=False):
# Add some further variable for the conveniance of the plugins
if notification_logging >= 2:
+ encoded_context = dict(raw_context.items())
+ convert_context_to_unicode(encoded_context)
notify_log("Raw notification context:\n"
- + "\n".join([" %s=%s" % v for v
in sorted(raw_context.items())]))
+ + "\n".join([" %s=%s" % v for v
in sorted(encoded_context.items())]))
raw_keys = list(raw_context.keys())
complete_raw_context(raw_context)