Module: check_mk
Branch: master
Commit: b6caac944c843375e6e12e653ae8ec1bb4446348
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6caac944c8433…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 29 14:29:28 2016 +0200
Added check for up-to-date pylint version
---
pylint/Makefile | 4 ++++
pylint/pylint_cmk.py | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/pylint/Makefile b/pylint/Makefile
index e11f349..3aaacfd 100644
--- a/pylint/Makefile
+++ b/pylint/Makefile
@@ -6,6 +6,7 @@ help:
@echo "misc - Check other files (mkeventd, active checks, agent plugins)"
@echo
@echo "build - Run all checks from build system"
+ @echo "setup - Install required tools"
all: modules web checks misc
@@ -27,3 +28,6 @@ build:
export PYLINT_OUTPUT="$$WORKDIR/pylint.log" ; \
echo -n > pylint.log ; \
$(MAKE) all
+
+setup:
+ sudo pip install --upgrade pylint
diff --git a/pylint/pylint_cmk.py b/pylint/pylint_cmk.py
index 1ce6a07..d23f2ac 100644
--- a/pylint/pylint_cmk.py
+++ b/pylint/pylint_cmk.py
@@ -226,9 +226,17 @@ class CMKParseableTextReporter(CMKFixFileMixin,
ParseableTextReporter):
name = "cmk_parseable"
+def verify_pylint_version():
+ import pylint
+ if tuple(map(int, pylint.__version__.split("."))) < (1, 5, 5):
+ raise Exception("You need to use at least pylint 1.5.5. Run \"make
setup\" in "
+ "pylint directory to get the current version.")
+
# Is called by pylint to load this plugin
def register(linter):
+ verify_pylint_version()
+
sys.path = glob.glob("/omd/versions/default/lib/python/*.egg") \
+ [ "/omd/versions/default/lib/python" ] \
+ sys.path