From 5d0a0d27e5da3db71eea1a3b9618e8be05d39b36 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 06:47:01 +0100 Subject: [PATCH] Fix lang issue on zypper absent (#1175) (#1187) * Fix lang issue on zypper absent * Add fragment changelog * Update changelogs/fragments/1175-zypper-absent-lang.yml Some outfit Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit 4842f67da1c26adaa8a68174aa93bdc9d5fc64ac) Co-authored-by: Laurent G --- changelogs/fragments/1175-zypper-absent-lang.yml | 2 ++ plugins/modules/packaging/os/zypper.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/1175-zypper-absent-lang.yml diff --git a/changelogs/fragments/1175-zypper-absent-lang.yml b/changelogs/fragments/1175-zypper-absent-lang.yml new file mode 100644 index 0000000000..05d0a3d947 --- /dev/null +++ b/changelogs/fragments/1175-zypper-absent-lang.yml @@ -0,0 +1,2 @@ +bugfixes: +- zypper - force ``LANG=C`` to as zypper is looking in XML output where attribute could be translated (https://github.com/ansible-collections/community.general/issues/1175). diff --git a/plugins/modules/packaging/os/zypper.py b/plugins/modules/packaging/os/zypper.py index 5997cfa4e2..f6c623ef35 100644 --- a/plugins/modules/packaging/os/zypper.py +++ b/plugins/modules/packaging/os/zypper.py @@ -515,6 +515,8 @@ def main(): supports_check_mode=True ) + module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C') + name = module.params['name'] state = module.params['state'] update_cache = module.params['update_cache']