From 2ae3dbcc6a8e773b550e3db697cc0b28047547ac Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 5 Apr 2016 19:24:43 +0200 Subject: [PATCH] Set the locales to avoid issue with screenscrapping See https://github.com/ansible/ansible-modules-core/pull/2462 for details on why this could happen --- lib/ansible/modules/web_infrastructure/supervisorctl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/web_infrastructure/supervisorctl.py b/lib/ansible/modules/web_infrastructure/supervisorctl.py index 087cb113d6b..6ac5bc7de67 100644 --- a/lib/ansible/modules/web_infrastructure/supervisorctl.py +++ b/lib/ansible/modules/web_infrastructure/supervisorctl.py @@ -120,6 +120,9 @@ def main(): password = module.params.get('password') supervisorctl_path = module.params.get('supervisorctl_path') + # we check error message for a pattern, so we need to make sure that's in C locale + module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C') + if supervisorctl_path: if os.path.exists(supervisorctl_path) and is_executable(supervisorctl_path): supervisorctl_args = [supervisorctl_path]