Module: check_mk
Branch: master
Commit: 9523308cfda0c948601fbb65fe1cf91cef228a6e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9523308cfda0c9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 19 08:49:28 2018 +0100
Cleaned up tryint() from lib
Change-Id: I3d0b61b764a6657cb1d91cd479520c10392853bc
---
web/htdocs/lib.py | 7 -------
web/plugins/wato/bi.py | 6 ++++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index cb5c7d4..1a1dacc 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -134,10 +134,3 @@ def saveint(x):
return int(x)
except:
return 0
-
-
-def tryint(x):
- try:
- return int(x)
- except:
- return x
diff --git a/web/plugins/wato/bi.py b/web/plugins/wato/bi.py
index 821f85c..16c8fa3 100644
--- a/web/plugins/wato/bi.py
+++ b/web/plugins/wato/bi.py
@@ -320,6 +320,12 @@ class ModeBI(WatoMode):
# Make some conversions so that the format of the
# valuespecs is matched
def _convert_rule_from_bi(self, rule, ruleid):
+ def tryint(x):
+ try:
+ return int(x)
+ except:
+ return x
+
if type(rule) == tuple:
rule = {
"title" : rule[0],