mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-15 05:11:23 +00:00
Ensure standard locale in run_command (group5-batch11) (#11782)
* Fix locale env vars in run_command() calls for group5 batch11 modules Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure locale-independent output parsing in apt_repo, easy_install, pear, and zypper_repository_info. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add changelog fragment for PR #11782 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:
13
changelogs/fragments/11782-group5-batch11-locale.yml
Normal file
13
changelogs/fragments/11782-group5-batch11-locale.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
bugfixes:
|
||||
- apt_repo - 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/11782).
|
||||
- easy_install - 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/11782).
|
||||
- pear - 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/11782).
|
||||
- zypper_repository_info - 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/11782).
|
||||
@@ -122,6 +122,7 @@ def main():
|
||||
update=dict(type="bool", default=False),
|
||||
),
|
||||
)
|
||||
module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"}
|
||||
|
||||
if not os.path.exists(APT_REPO_PATH):
|
||||
module.fail_json(msg="cannot find /usr/bin/apt-repo")
|
||||
|
||||
@@ -139,6 +139,7 @@ def main():
|
||||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=arg_spec, supports_check_mode=True)
|
||||
module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"}
|
||||
|
||||
name = module.params["name"]
|
||||
env = module.params["virtualenv"]
|
||||
|
||||
@@ -298,6 +298,7 @@ def main():
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"}
|
||||
|
||||
p = module.params
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ def _parse_repos(module):
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(argument_spec=dict(), supports_check_mode=True)
|
||||
module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"}
|
||||
|
||||
deps.validate(parseXML)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user