1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-18 01:41:35 +00:00

Ensure standard locale in run_command (group4-batch1) (#11765)

* ensure standard locale in run_command (group4)

Adds ``LANGUAGE=C`` and ``LC_ALL=C`` to the ``environ_update`` passed to
``run_command()`` calls in modules that parse command output, to prevent
locale-dependent parsing failures on non-C-locale systems.

Modules updated: dconf, pkgng, terraform.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* add changelog fragment for group4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* add PR link to group4 changelog fragment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix changelog fragment: rename with PR prefix, fix URL order

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky 2026-04-12 23:20:51 +12:00 committed by GitHub
parent 6f12d93057
commit 2297a5c876
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View file

@ -156,7 +156,7 @@ def query_update(module, run_pkgng, name):
def pkgng_older_than(module, pkgng_path, compare_version):
rc, out, err = module.run_command([pkgng_path, "-v"])
rc, out, err = module.run_command([pkgng_path, "-v"], environ_update={"LANGUAGE": "C", "LC_ALL": "C"})
version = [int(x) for x in re.split(r"[\._]", out)]
i = 0
@ -455,7 +455,7 @@ def main():
):
args = ("-g",) + args
pkgng_env = {"BATCH": "yes"}
pkgng_env = {"BATCH": "yes", "LANGUAGE": "C", "LC_ALL": "C"}
if p["ignore_osver"]:
pkgng_env["IGNORE_OSVERSION"] = "yes"