From a996d4836aa4dadc5896f99eb46d35436546d3c4 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Fri, 18 May 2018 07:55:37 +0200 Subject: [PATCH] rhsm_repository: use C locale for out/err scraping (#40338) --- lib/ansible/modules/packaging/os/rhsm_repository.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/rhsm_repository.py b/lib/ansible/modules/packaging/os/rhsm_repository.py index 439e1cd3e1..e276125436 100644 --- a/lib/ansible/modules/packaging/os/rhsm_repository.py +++ b/lib/ansible/modules/packaging/os/rhsm_repository.py @@ -88,7 +88,8 @@ def run_subscription_manager(module, arguments): if not rhsm_bin: module.fail_json(msg='The executable file subscription-manager was not found in PATH') - rc, out, err = module.run_command("%s %s" % (rhsm_bin, " ".join(arguments))) + lang_env = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C') + rc, out, err = module.run_command("%s %s" % (rhsm_bin, " ".join(arguments)), environ_update=lang_env) if rc == 1 and (err == 'The password you typed is invalid.\nPlease try again.\n' or os.getuid() != 0): module.fail_json(msg='The executable file subscription-manager must be run using root privileges')