Module: check_mk
Branch: master
Commit: 86568aaf90e8565ab09a74262f4ebdf214a38d9e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86568aaf90e856…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 17 10:47:33 2015 +0100
#2793 FIX Prevent python unicode warnings for services with umlauts
The parameter overview page for a service failed when there were umlauts
in the service description. This bug was introduced a few months ago during
some internal code restructuring concerning unicode strings.
---
.werks/2793 | 11 +++++++++++
ChangeLog | 1 +
modules/automation.py | 2 +-
modules/check_mk.py | 3 +++
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/2793 b/.werks/2793
new file mode 100644
index 0000000..64ecdec
--- /dev/null
+++ b/.werks/2793
@@ -0,0 +1,11 @@
+Title: Parameter Overview: Prevent python unicode warnings for services with umlauts
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447753328
+Class: fix
+
+The parameter overview page for a service failed when there were umlauts
+in the service description. This bug was introduced a few months ago during
+some internal code restructuring concerning unicode strings.
diff --git a/ChangeLog b/ChangeLog
index f50e247..9e6912a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,7 @@
* 2760 FIX: Fixed case where "activate changes" was not commiting the
pending changes entries correctly...
* 2767 FIX: Fixed broken user list when non unicode mail addresses are loaded
* 2791 FIX: Service parameter overview: Fixed problem displaying incorrect rule for
classical checks...
+ * 2793 FIX: Prevent python unicode warnings for services with umlauts...
Notifications:
* 2728 FIX: Removed debug notification script (was not executable)...
diff --git a/modules/automation.py b/modules/automation.py
index f303302..578fd4a 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -240,7 +240,7 @@ def schedule_inventory_check(hostname):
def automation_analyse_service(args):
global g_hostname
hostname = args[0]
- servicedesc = args[1]
+ servicedesc = args[1].decode("utf-8")
g_hostname = hostname # To be sure for all subfunctions
# We just consider types of checks that are managed via WATO.
diff --git a/modules/check_mk.py b/modules/check_mk.py
index f654be4..9d3639b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2249,6 +2249,9 @@ def service_description(check_type, item):
else:
descr_format = check_info[check_type]["service_description"]
+ if type(descr_format) == str:
+ descr_format = descr_format.decode("utf-8")
+
# Note: we strip the service description (remove spaces).
# One check defines "Pages %s" as a description, but the item
# can by empty in some cases. Nagios silently drops leading