diff options
author | Matt Clay <matt@mystile.com> | 2019-07-25 22:51:26 -0700 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2019-07-25 23:29:42 -0700 |
commit | cf9999692a27bb68a6a2d8100e154c1929bbd02b (patch) | |
tree | 9ea251969ad505624ba0d8120cf2e0b054467209 | |
parent | db7e9aa0518b927b776e3d55d93f90583692a2c2 (diff) | |
download | ansible-cf9999692a27bb68a6a2d8100e154c1929bbd02b.tar.gz |
Fix ansible-test encoding issues.
This fixes `ansible-test sanity --list-tests` which was failing when `LC_ALL=C` was set.
-rw-r--r-- | test/runner/lib/target.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/runner/lib/target.py b/test/runner/lib/target.py index dae07c2f1c..b8a3be8541 100644 --- a/test/runner/lib/target.py +++ b/test/runner/lib/target.py @@ -15,6 +15,7 @@ from lib.util import ( read_lines_without_comments, is_subdir, to_text, + to_bytes, ) from lib.data import ( @@ -257,7 +258,7 @@ def walk_test_targets(path=None, module_path=None, extensions=None, prefix=None, if prefix and not name.startswith(prefix): continue - if os.path.islink(file_path): + if os.path.islink(to_bytes(file_path)): # special case to allow a symlink of ansible_release.py -> ../release.py if file_path != 'lib/ansible/module_utils/ansible_release.py': continue @@ -272,7 +273,7 @@ def walk_test_targets(path=None, module_path=None, extensions=None, prefix=None, file_paths.append(file_path) for file_path in file_paths: - if os.path.islink(file_path): + if os.path.islink(to_bytes(file_path)): continue yield TestTarget(file_path, module_path, prefix, path) |