mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes #11055 - Set locale via LC_ALL
This commit is contained in:
parent
9a29fee991
commit
260a3e5ce7
2 changed files with 4 additions and 4 deletions
|
@ -735,8 +735,8 @@ class AnsibleModule(object):
|
|||
# issues but is preferable to simply failing because
|
||||
# of an unknown locale
|
||||
locale.setlocale(locale.LC_ALL, 'C')
|
||||
os.environ['LANG'] = 'C'
|
||||
os.environ['LC_CTYPE'] = 'C'
|
||||
os.environ['LANG'] = 'C'
|
||||
os.environ['LC_ALL'] = 'C'
|
||||
except Exception, e:
|
||||
self.fail_json(msg="An unknown error was encountered while attempting to validate the locale: %s" % e)
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ class ShellModule(object):
|
|||
def env_prefix(self, **kwargs):
|
||||
'''Build command prefix with environment variables.'''
|
||||
env = dict(
|
||||
LANG = C.DEFAULT_MODULE_LANG,
|
||||
LC_CTYPE = C.DEFAULT_MODULE_LANG,
|
||||
LANG = C.DEFAULT_MODULE_LANG,
|
||||
LC_ALL = C.DEFAULT_MODULE_LANG,
|
||||
)
|
||||
env.update(kwargs)
|
||||
return ' '.join(['%s=%s' % (k, pipes.quote(unicode(v))) for k,v in env.items()])
|
||||
|
|
Loading…
Reference in a new issue