Fix path handling in validate-modules sanity test.

pull/36460/head
Matt Clay 6 years ago
parent fdbd1297cf
commit a9b58b84d8

@ -17,7 +17,6 @@ from lib.util import (
SubprocessError,
display,
run_command,
deepest_path,
)
from lib.ansible_util import (
@ -45,10 +44,14 @@ class ValidateModulesTest(SanitySingleVersion):
:type targets: SanityTargets
: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)
paths = [deepest_path(i.path, 'lib/ansible/modules/') for i in targets.include_external]
paths = sorted(set(p for p in paths if p))
paths = sorted([i.path for i in targets.include if i.module and i.path not in skip_paths_set])
if not paths:
return SanitySkipped(self.name)
@ -60,9 +63,6 @@ class ValidateModulesTest(SanitySingleVersion):
'--arg-spec',
] + paths
with open(VALIDATE_SKIP_PATH, 'r') as skip_fd:
skip_paths = skip_fd.read().splitlines()
invalid_ignores = []
with open(VALIDATE_IGNORE_PATH, 'r') as ignore_fd:
@ -81,11 +81,6 @@ class ValidateModulesTest(SanitySingleVersion):
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:
cmd.extend([
'--base-branch', args.base_branch,

@ -2414,7 +2414,6 @@ lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py E325
lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py E326
lib/ansible/modules/network/nxos/nxos_command.py E325
lib/ansible/modules/network/nxos/nxos_command.py E326
lib/ansible/modules/network/nxos/nxos_config.py E324
lib/ansible/modules/network/nxos/nxos_config.py E325
lib/ansible/modules/network/nxos/nxos_config.py E326
lib/ansible/modules/network/nxos/nxos_evpn_global.py E325

Loading…
Cancel
Save