mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 00:16:49 +00: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:
@@ -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']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user