1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Delegate ansible-test with LC_ALL=en_US.UTF-8.

This fixes encoding issues in ansible-test when running tests in
delegated environments that do not have LC_ALL or LANG set by default.
This commit is contained in:
Matt Clay 2019-01-11 14:37:35 -08:00
parent 518699988f
commit dca4eb3dcd

View file

@ -432,6 +432,13 @@ def generate_command(args, path, options, exclude, require):
options['--color'] = 1
cmd = [path]
# Force the encoding used during delegation.
# This is only needed because ansible-test relies on Python's file system encoding.
# Environments that do not have the locale configured are thus unable to work with unicode file paths.
# Examples include FreeBSD and some Linux containers.
cmd = ['/usr/bin/env', 'LC_ALL=en_US.UTF-8'] + cmd
cmd += list(filter_options(args, sys.argv[1:], options, exclude, require))
cmd += ['--color', 'yes' if args.color else 'no']