diff options
author | Brian Coca <bcoca@ansible.com> | 2015-05-26 11:49:56 -0400 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2015-05-26 11:49:56 -0400 |
commit | 6000db7e5d6da1ac61bc40eb6788466a1005f3a7 (patch) | |
tree | f15ab2ecc8d2b59fb03ef85337ee4ff251f0e942 | |
parent | b740b0372af8e91c0f8217d8e6350c15e1be2b66 (diff) | |
parent | a1adff4ff00091741cd95301d66a33cac161ea9d (diff) | |
download | ansible-6000db7e5d6da1ac61bc40eb6788466a1005f3a7.tar.gz |
Merge pull request #9636 from Batmat/fix-message-i18n-parsing-error
Setting LC_MESSAGES: prevent unparseable messages (fixes issue #9635)
-rw-r--r-- | lib/ansible/module_utils/basic.py | 1 | ||||
-rw-r--r-- | lib/ansible/runner/shell_plugins/sh.py | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index a31623ab51..99971d17b1 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -868,6 +868,7 @@ class AnsibleModule(object): locale.setlocale(locale.LC_ALL, 'C') os.environ['LANG'] = 'C' os.environ['LC_CTYPE'] = 'C' + os.environ['LC_MESSAGES'] = 'C' except Exception, e: self.fail_json(msg="An unknown error was encountered while attempting to validate the locale: %s" % e) diff --git a/lib/ansible/runner/shell_plugins/sh.py b/lib/ansible/runner/shell_plugins/sh.py index 5fb0dc3add..81810bcf8f 100644 --- a/lib/ansible/runner/shell_plugins/sh.py +++ b/lib/ansible/runner/shell_plugins/sh.py @@ -32,6 +32,7 @@ class ShellModule(object): env = dict( LANG = C.DEFAULT_MODULE_LANG, LC_CTYPE = C.DEFAULT_MODULE_LANG, + LC_MESSAGES = C.DEFAULT_MODULE_LANG, ) env.update(kwargs) return ' '.join(['%s=%s' % (k, pipes.quote(unicode(v))) for k,v in env.items()]) |