Set the default LANG to en_US.UTF-8 and also set LC_CTYPE

Fixes #6737
This commit is contained in:
James Cammarata 2014-04-22 00:47:26 -05:00
parent 491a00af21
commit c115c34a1f
2 changed files with 2 additions and 1 deletions

View file

@ -108,7 +108,7 @@ DEFAULT_MODULE_NAME = get_config(p, DEFAULTS, 'module_name', None,
DEFAULT_PATTERN = get_config(p, DEFAULTS, 'pattern', None, '*') DEFAULT_PATTERN = get_config(p, DEFAULTS, 'pattern', None, '*')
DEFAULT_FORKS = get_config(p, DEFAULTS, 'forks', 'ANSIBLE_FORKS', 5, integer=True) DEFAULT_FORKS = get_config(p, DEFAULTS, 'forks', 'ANSIBLE_FORKS', 5, integer=True)
DEFAULT_MODULE_ARGS = get_config(p, DEFAULTS, 'module_args', 'ANSIBLE_MODULE_ARGS', '') DEFAULT_MODULE_ARGS = get_config(p, DEFAULTS, 'module_args', 'ANSIBLE_MODULE_ARGS', '')
DEFAULT_MODULE_LANG = get_config(p, DEFAULTS, 'module_lang', 'ANSIBLE_MODULE_LANG', 'C') DEFAULT_MODULE_LANG = get_config(p, DEFAULTS, 'module_lang', 'ANSIBLE_MODULE_LANG', 'en_US.UTF-8')
DEFAULT_TIMEOUT = get_config(p, DEFAULTS, 'timeout', 'ANSIBLE_TIMEOUT', 10, integer=True) DEFAULT_TIMEOUT = get_config(p, DEFAULTS, 'timeout', 'ANSIBLE_TIMEOUT', 10, integer=True)
DEFAULT_POLL_INTERVAL = get_config(p, DEFAULTS, 'poll_interval', 'ANSIBLE_POLL_INTERVAL', 15, integer=True) DEFAULT_POLL_INTERVAL = get_config(p, DEFAULTS, 'poll_interval', 'ANSIBLE_POLL_INTERVAL', 15, integer=True)
DEFAULT_REMOTE_USER = get_config(p, DEFAULTS, 'remote_user', 'ANSIBLE_REMOTE_USER', active_user) DEFAULT_REMOTE_USER = get_config(p, DEFAULTS, 'remote_user', 'ANSIBLE_REMOTE_USER', active_user)

View file

@ -192,6 +192,7 @@ class AnsibleModule(object):
self.argument_spec[k] = v self.argument_spec[k] = v
os.environ['LANG'] = MODULE_LANG os.environ['LANG'] = MODULE_LANG
os.environ['LC_CTYPE'] = MODULE_LANG
(self.params, self.args) = self._load_params() (self.params, self.args) = self._load_params()
self._legal_inputs = ['CHECKMODE', 'NO_LOG'] self._legal_inputs = ['CHECKMODE', 'NO_LOG']