Module: check_mk
Branch: master
Commit: 78ef0da5165baf08454d49aab2273f2fc3ebc661
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=78ef0da5165baf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 14 08:53:21 2016 +0100
Worked around recently introduced encoding issues in the GUI
Change-Id: I33dcaa7235aaf196cc326f0aa4f6e6ddbeaf8ba5
---
web/htdocs/htmllib.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index ff50d36..7d34b24 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -189,7 +189,23 @@ class HTML(object):
def __str__(self):
- return self.__bytebatzen__()
+ # Against the sense of the __str__() method, we need to return the value
+ # as unicode here. Why? There are many cases where something like
+ # "%s" % HTML(...) is done in the GUI code. This calls the __str__ function
+ # because the origin is a str() object. The call will then return a UTF-8
+ # encoded str() object. This brings a lot of compatbility issues to the code
+ # which can not be solved easily.
+ # To deal with this situation we need the implicit conversion from str to
+ # unicode that happens when we return a unicode value here. In all relevant
+ # cases this does exactly what we need. It would only fail if the origin
+ # string contained characters that can not be decoded with the ascii codec
+ # which is not relevant for us here.
+ #
+ # This is problematic:
+ # html.write("%s" % HTML("ä"))
+ #
+ # Bottom line: We should relly cleanup internal unicode/str handling.
+ return self.value
def __repr__(self):
Module: check_mk
Branch: master
Commit: 7a2f81987bb02219d60f9c84c04c565d18f092af
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7a2f81987bb022…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 13 10:57:51 2016 +0100
4140 FIX Views: Download agent output action was not displayed correctly on SNMP+Agent hosts
Change-Id: I4e6b8907f37481c6274c197d385e2ecddef55339
---
.werks/4140 | 9 +++++++++
ChangeLog | 1 +
web/plugins/icons/wato.py | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/4140 b/.werks/4140
new file mode 100644
index 0000000..87f97e9
--- /dev/null
+++ b/.werks/4140
@@ -0,0 +1,9 @@
+Title: Views: Download agent output action was not displayed correctly on SNMP+Agent hosts
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i3
+Date: 1481623042
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index a816edb..4152334 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,7 @@
* 4128 FIX: Fixed exception in "Virtual host tree" snapin in case a user tries to access a not existing tree
* 4129 FIX: Fixed possible exception when a view is linking to a not permitted other view
* 4137 FIX: List of strings: New fields are now added when last field is not empty...
+ * 4140 FIX: Views: Download agent output action was not displayed correctly on SNMP+Agent hosts
WATO:
* 3984 Permissions can now be filtered by providing a search term on the "edit role" page...
diff --git a/web/plugins/icons/wato.py b/web/plugins/icons/wato.py
index a560636..d8720c8 100644
--- a/web/plugins/icons/wato.py
+++ b/web/plugins/icons/wato.py
@@ -99,7 +99,7 @@ def paint_download_host_info(what, row, tags, host_custom_vars, ty):
# be piggyback data available which should be downloadable.
if ty == "walk" and "snmp" not in tags:
return
- elif ty == "agent" and "snmp" in tags and "agent" not in tags:
+ elif ty == "agent" and "snmp" in tags and "tcp" not in tags:
return
params = [("host", row["host_name"]),