Module: check_mk
Branch: master
Commit: 017d7a68e2ca3bb0cd27e769ff181619ebbca360
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=017d7a68e2ca3b…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Jun 12 10:09:05 2018 +0200
Fix: Key is allways present (but None); can't use "if key in info".
Change-Id: Ie2efe8d66da42ff0d02c4c8ed3f042bf79e1a280
---
tests/testlib/__init__.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index e6344aa..3a68960 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -1800,10 +1800,11 @@ class Check(object):
def run_parse(self, info):
- if "parse_function" not in self.info:
+ parse_func = self.info.get("parse_function")
+ if not parse_func:
raise Exception("This check has no parse function defined")
- return self.info["parse_function"](info)
+ return parse_func(info)
def run_discovery(self, info):