Fix ansible-test python and pip executable search.

This commit is contained in:
Matt Clay 2018-03-14 11:35:59 -07:00
parent dd37857884
commit a8487feb70
14 changed files with 81 additions and 75 deletions

View file

@ -15,6 +15,7 @@ from lib.util import (
SubprocessError,
run_command,
parse_to_dict,
display,
find_executable,
)
@ -22,6 +23,10 @@ from lib.config import (
SanityConfig,
)
UNSUPPORTED_PYTHON_VERSIONS = (
'2.6',
)
class RstcheckTest(SanitySingleVersion):
"""Sanity test using rstcheck."""
@ -31,6 +36,10 @@ class RstcheckTest(SanitySingleVersion):
:type targets: SanityTargets
:rtype: SanityResult
"""
if args.python_version in UNSUPPORTED_PYTHON_VERSIONS:
display.warning('Skipping rstcheck on unsupported Python version %s.' % args.python_version)
return SanitySkipped(self.name)
with open('test/sanity/rstcheck/ignore-substitutions.txt', 'r') as ignore_fd:
ignore_substitutions = sorted(set(ignore_fd.read().splitlines()))
@ -40,8 +49,8 @@ class RstcheckTest(SanitySingleVersion):
return SanitySkipped(self.name)
cmd = [
'python%s' % args.python_version,
find_executable('rstcheck'),
args.python_executable,
'-m', 'rstcheck',
'--report', 'warning',
'--ignore-substitutions', ','.join(ignore_substitutions),
] + paths