Module: check_mk
Branch: master
Commit: 4cafb69177baa6af11621de3ea2866f97c7a94c7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4cafb69177baa6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 29 11:58:45 2015 +0200
Improved validation of invalid man pages
---
modules/check_mk.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index bfe067d..0c0c00b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3546,10 +3546,12 @@ def parse_man_header(checkname, path):
lineno, path, line))
break
- if "agents" not in parsed:
- raise Exception("Section agents missing in man page of %s\n" %
(checkname))
- else:
- parsed["agents"] = parsed["agents"].replace("
","").split(",")
+ # verify mandatory keys. FIXME: This list may be incomplete
+ for key in [ "title", "agents", "license",
"distribution", "description", ]:
+ if key not in parsed:
+ raise Exception("Section %s missing in man page of %s" % (key,
checkname))
+
+ parsed["agents"] = parsed["agents"].replace("
","").split(",")
if parsed.get("catalog"):
parsed["catalog"] = parsed["catalog"].split("/")