From 36bcab8a687ead9909dc58663176dae18f1794e5 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Sun, 5 Nov 2017 15:28:05 +0100 Subject: [PATCH] yum: use the C locale when screen scraping (#32203) (cherry picked from commit a8ab1a0b200881f52f564d28db90f10730c1f0b5) --- lib/ansible/modules/packaging/os/yum.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/yum.py b/lib/ansible/modules/packaging/os/yum.py index 911948c36ff..6763ce62d2f 100644 --- a/lib/ansible/modules/packaging/os/yum.py +++ b/lib/ansible/modules/packaging/os/yum.py @@ -1111,7 +1111,8 @@ def latest(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, in res['changed'] = True elif len(pkgs['install']) or len(will_update): cmd = yum_basecmd + ['install'] + pkgs['install'] + pkgs['update'] - rc, out, err = module.run_command(cmd) + lang_env = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C') + rc, out, err = module.run_command(cmd, environ_update=lang_env) out_lower = out.strip().lower() if not out_lower.endswith("no packages marked for update") and \ not out_lower.endswith("nothing to do"):