mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
[PR #11765/2297a5c8 backport][stable-12] Ensure standard locale in run_command (group4-batch1) (#11792)
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.
* add changelog fragment for group4
* add PR link to group4 changelog fragment
* fix changelog fragment: rename with PR prefix, fix URL order
---------
(cherry picked from commit 2297a5c876)
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:
@@ -311,7 +311,7 @@ class DconfPreference:
|
||||
"""
|
||||
command = [self.dconf_bin, "read", key]
|
||||
|
||||
rc, out, err = self.module.run_command(command)
|
||||
rc, out, err = self.module.run_command(command, environ_update={"LANGUAGE": "C", "LC_ALL": "C"})
|
||||
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=f"dconf failed while reading the value with error: {err}", out=out, err=err)
|
||||
|
||||
Reference in New Issue
Block a user