Module: check_mk
Branch: master
Commit: 9c1fbc4d035c0be6387a78ba8d2dc4555f0994ca
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9c1fbc4d035c0b…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Jun 20 13:26:32 2016 +0200
bugfix in 3144 didn't work in all cases
---
modules/check_mk_base.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index b0cbad7..180767d 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1918,8 +1918,13 @@ def submit_check_result(host, servicedesc, result, sa,
cached_at=None, cache_int
infotext = core_state_names[state] + " - " + infotext
# make sure that plugin output does not contain a vertical bar. If that is the
- # case then replace it with a Uniocode "Light vertical bar"
- infotext = infotext.replace("|",
u"\u2758".encode("utf8"))
+ # case then replace it with a Uniocode "Light vertical bar
+ if isinstance(infotext, unicode):
+ # regular check results are unicode...
+ infotext = infotext.replace(u"|", u"\u2758")
+ else:
+ # ...crash dumps, and hard-coded outputs are regular strings
+ infotext = infotext.replace("|",
u"\u2758".encode("utf8"))
# Aggregated service -> store for later
if sa != "":