Module: check_mk
Branch: master
Commit: e2a991c8f550915aa155e9b8952e7eaea583f1a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e2a991c8f55091…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 1 09:20:31 2018 +0100
Revert "Fixed pylint imports from site specific paths"
This reverts commit b4af2add3bae8f4317087e9e3a494358beb031ed.
---
tests/testlib/pylint_cmk.py | 26 ++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/tests/testlib/pylint_cmk.py b/tests/testlib/pylint_cmk.py
index c989066..c73a329 100644
--- a/tests/testlib/pylint_cmk.py
+++ b/tests/testlib/pylint_cmk.py
@@ -10,7 +10,6 @@ import tempfile
from pylint.reporters.text import ColorizedTextReporter, ParseableTextReporter
from pylint.utils import Message
-from pylint.lint import Run
from testlib import repo_path, cmk_path, cmc_path, cme_path
@@ -40,6 +39,8 @@ def add_file(f, path):
def run_pylint(base_path, check_files=None): #, cleanup_test_dir=False):
pylint_args = os.environ.get("PYLINT_ARGS", "")
+ if pylint_args:
+ pylint_args += " "
pylint_cfg = repo_path() + "/pylintrc"
@@ -49,25 +50,10 @@ def run_pylint(base_path, check_files=None): #,
cleanup_test_dir=False):
return 0 # nothing to do
os.putenv("TEST_PATH", repo_path() + "/tests")
-
- args = []
- if pylint_args:
- args += pylint_args.split(" ")
-
- args += [ "--rcfile=%s" % pylint_cfg ]
- args += check_files
-
- print("Running pylint in %r with args: %r" % (base_path, args))
-
- try:
- orig_wd = os.getcwd()
- os.chdir(base_path)
-
- run = Run(args, exit=False)
- exit_code = run.linter.msg_status
- finally:
- os.chdir(orig_wd)
-
+ cmd = "pylint --rcfile=\"%s\" %s%s" % (pylint_cfg, pylint_args,
" ".join(check_files))
+ print("Running pylint with: %s" % cmd)
+ p = subprocess.Popen(cmd, shell=True, cwd=base_path)
+ exit_code = p.wait()
print("Finished with exit code: %d" % exit_code)
#if exit_code == 0 and cleanup_test_dir: