mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-17 09:21:32 +00:00
openbsd_pkg, sorcery: ensure standard locale in run_command (group4-batch2) (#11767)
* ensure standard locale in run_command (group4-batch2) 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: openbsd_pkg, sorcery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * add changelog fragment for group4-batch2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * add changelog fragment for group4-batch2 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:
parent
2297a5c876
commit
f4f2bfe847
3 changed files with 5 additions and 2 deletions
3
changelogs/fragments/11767-group4-batch2-locale.yml
Normal file
3
changelogs/fragments/11767-group4-batch2-locale.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
bugfixes:
|
||||
- openbsd_pkg - ensure ``LANGUAGE=C`` and ``LC_ALL=C`` are set when running commands that parse output (https://github.com/ansible-collections/community.general/issues/11737, https://github.com/ansible-collections/community.general/pull/11767).
|
||||
- sorcery - ensure ``LANGUAGE=C`` and ``LC_ALL=C`` are set when running commands that parse output (https://github.com/ansible-collections/community.general/issues/11737, https://github.com/ansible-collections/community.general/pull/11767).
|
||||
|
|
@ -166,7 +166,7 @@ def execute_command(cmd, module):
|
|||
# We set TERM to 'dumb' to keep pkg_add happy if the machine running
|
||||
# ansible is using a TERM that the managed machine does not know about,
|
||||
# e.g.: "No progress meter: failed termcap lookup on xterm-kitty".
|
||||
return module.run_command(cmd_args, environ_update={"TERM": "dumb"})
|
||||
return module.run_command(cmd_args, environ_update={"TERM": "dumb", "LANGUAGE": "C", "LC_ALL": "C"})
|
||||
|
||||
|
||||
def get_all_installed(module):
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@ def main():
|
|||
SORCERY[c] = module.get_bin_path(c, True)
|
||||
|
||||
# prepare environment: run sorcery commands without asking questions
|
||||
module.run_command_environ_update = dict(PROMPT_DELAY="0", VOYEUR="0")
|
||||
module.run_command_environ_update = dict(PROMPT_DELAY="0", VOYEUR="0", LANGUAGE="C", LC_ALL="C")
|
||||
|
||||
params = module.params
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue