Module: check_mk
Branch: master
Commit: d5d8ff5b4054ac23cb82e75c218628eba70a3d45
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d5d8ff5b4054ac…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 22 16:44:15 2014 +0100
#1795 Fix internal exception in WATO rule for filesystems
In the WATO rule for filesystems there was a bug such that you
could not configure any filesystem levels. This has been fixed.
The bug had been introduced recently.
---
.werks/1795 | 11 +++++++++++
web/htdocs/htmllib.py | 3 ++-
web/htdocs/valuespec.py | 3 ++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/1795 b/.werks/1795
new file mode 100644
index 0000000..0d4c285
--- /dev/null
+++ b/.werks/1795
@@ -0,0 +1,11 @@
+Title: Fix internal exception in WATO rule for filesystems
+Level: 2
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1419262975
+Class: fix
+
+In the WATO rule for filesystems there was a bug such that you
+could not configure any filesystem levels. This has been fixed.
+The bug had been introduced recently.
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index cf2bd5d..12d7912 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -529,7 +529,8 @@ class html:
sorted.sort(lambda a,b: cmp(a[1].lower(), b[1].lower()))
self.select(varname, sorted, deflt, onchange, attrs)
- # Choices is a list pairs of (key, title)
+ # Choices is a list pairs of (key, title). They keys of the choices
+ # and the default value must be of type None, str or unicode.
def select(self, varname, choices, deflt="", onchange=None, attrs = {}):
current = self.var_utf8(varname, deflt)
onchange_code = onchange and " onchange=\"%s\"" % (onchange)
or ""
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 5d14de3..14568e1 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -323,7 +323,8 @@ class Filesize(Integer):
exp, count = self.get_exponent(value)
html.number_input(varprefix + '_size', count, size = self._size)
html.write(" ")
- html.select(varprefix + '_unit', enumerate(self._names), exp)
+ choices = [ (str(nr), name) for (nr, name) in enumerate(self._names) ]
+ html.select(varprefix + '_unit', choices, str(exp))
def from_html_vars(self, varprefix):
try: