[PR #11777/a9d6bb2a backport][stable-12] Ensure standard locale in run_command (group5-batch6) (#11810)

Ensure standard locale in run_command (group5-batch6) (#11777)

* Fix locale env vars in run_command() calls for group5 batch6 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in yum_versionlock and zypper_repository.



* Add changelog fragment for PR #11777



---------


(cherry picked from commit a9d6bb2a15)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
patchback[bot]
2026-04-12 22:27:00 +02:00
committed by GitHub
parent e757ff30b3
commit c65a675a52
3 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
bugfixes:
- yum_versionlock - set ``LANGUAGE`` and ``LC_ALL`` to ``C`` in ``run_command()`` calls to ensure locale-independent output parsing
(https://github.com/ansible-collections/community.general/issues/11737,
https://github.com/ansible-collections/community.general/pull/11777).
- zypper_repository - set ``LANGUAGE`` and ``LC_ALL`` to ``C`` in ``run_command()`` calls to ensure locale-independent output parsing
(https://github.com/ansible-collections/community.general/issues/11737,
https://github.com/ansible-collections/community.general/pull/11777).

View File

@@ -151,6 +151,7 @@ def main():
),
supports_check_mode=True,
)
module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"}
state = module.params["state"]
packages = module.params["name"]

View File

@@ -338,6 +338,7 @@ def main():
supports_check_mode=False,
required_one_of=[["state", "runrefresh"]],
)
module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"}
repo = module.params["repo"]
alias = module.params["name"]