From 95e2b7716af97cf4a042080c847ee15407078f21 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Mon, 13 Apr 2026 07:56:51 +1200 Subject: [PATCH] Ensure standard locale in run_command (group5-batch16) (#11787) * Fix locale env vars in run_command() calls for group5 batch16 (btrfs module_utils) Co-Authored-By: Claude Sonnet 4.6 * Add changelog fragment for PR #11787 Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Sonnet 4.6 --- changelogs/fragments/11787-group5-batch16-locale.yml | 2 ++ plugins/module_utils/btrfs.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/11787-group5-batch16-locale.yml diff --git a/changelogs/fragments/11787-group5-batch16-locale.yml b/changelogs/fragments/11787-group5-batch16-locale.yml new file mode 100644 index 0000000000..56e78013e2 --- /dev/null +++ b/changelogs/fragments/11787-group5-batch16-locale.yml @@ -0,0 +1,2 @@ +bugfixes: + - btrfs module_utils - set ``LANGUAGE`` and ``LC_ALL`` environment variables to ``C`` in all ``run_command()`` calls (https://github.com/ansible-collections/community.general/issues/11737, https://github.com/ansible-collections/community.general/pull/11787). diff --git a/plugins/module_utils/btrfs.py b/plugins/module_utils/btrfs.py index 6b7d7691e0..fe2cc01c89 100644 --- a/plugins/module_utils/btrfs.py +++ b/plugins/module_utils/btrfs.py @@ -35,6 +35,7 @@ class BtrfsCommands: def __init__(self, module: AnsibleModule) -> None: self.__module = module + self.__module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"} self.__btrfs: str = self.__module.get_bin_path("btrfs", required=True) def filesystem_show(self) -> list[dict[str, t.Any]]: