|
|
@ -17,7 +17,6 @@ from lib.util import (
|
|
|
|
SubprocessError,
|
|
|
|
SubprocessError,
|
|
|
|
display,
|
|
|
|
display,
|
|
|
|
run_command,
|
|
|
|
run_command,
|
|
|
|
deepest_path,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
from lib.ansible_util import (
|
|
|
|
from lib.ansible_util import (
|
|
|
@ -45,10 +44,14 @@ class ValidateModulesTest(SanitySingleVersion):
|
|
|
|
:type targets: SanityTargets
|
|
|
|
:type targets: SanityTargets
|
|
|
|
:rtype: SanityResult
|
|
|
|
:rtype: SanityResult
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
with open(VALIDATE_SKIP_PATH, 'r') as skip_fd:
|
|
|
|
|
|
|
|
skip_paths = skip_fd.read().splitlines()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skip_paths_set = set(skip_paths)
|
|
|
|
|
|
|
|
|
|
|
|
env = ansible_environment(args, color=False)
|
|
|
|
env = ansible_environment(args, color=False)
|
|
|
|
|
|
|
|
|
|
|
|
paths = [deepest_path(i.path, 'lib/ansible/modules/') for i in targets.include_external]
|
|
|
|
paths = sorted([i.path for i in targets.include if i.module and i.path not in skip_paths_set])
|
|
|
|
paths = sorted(set(p for p in paths if p))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not paths:
|
|
|
|
if not paths:
|
|
|
|
return SanitySkipped(self.name)
|
|
|
|
return SanitySkipped(self.name)
|
|
|
@ -60,9 +63,6 @@ class ValidateModulesTest(SanitySingleVersion):
|
|
|
|
'--arg-spec',
|
|
|
|
'--arg-spec',
|
|
|
|
] + paths
|
|
|
|
] + paths
|
|
|
|
|
|
|
|
|
|
|
|
with open(VALIDATE_SKIP_PATH, 'r') as skip_fd:
|
|
|
|
|
|
|
|
skip_paths = skip_fd.read().splitlines()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
invalid_ignores = []
|
|
|
|
invalid_ignores = []
|
|
|
|
|
|
|
|
|
|
|
|
with open(VALIDATE_IGNORE_PATH, 'r') as ignore_fd:
|
|
|
|
with open(VALIDATE_IGNORE_PATH, 'r') as ignore_fd:
|
|
|
@ -81,11 +81,6 @@ class ValidateModulesTest(SanitySingleVersion):
|
|
|
|
|
|
|
|
|
|
|
|
ignore[path][code] = line
|
|
|
|
ignore[path][code] = line
|
|
|
|
|
|
|
|
|
|
|
|
skip_paths += [e.path for e in targets.exclude_external]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if skip_paths:
|
|
|
|
|
|
|
|
cmd += ['--exclude', '^(%s)' % '|'.join(skip_paths)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.base_branch:
|
|
|
|
if args.base_branch:
|
|
|
|
cmd.extend([
|
|
|
|
cmd.extend([
|
|
|
|
'--base-branch', args.base_branch,
|
|
|
|
'--base-branch', args.base_branch,
|
|
|
|