diff --git a/changelogs/fragments/11785-group5-batch14-locale.yml b/changelogs/fragments/11785-group5-batch14-locale.yml new file mode 100644 index 0000000000..59538c8628 --- /dev/null +++ b/changelogs/fragments/11785-group5-batch14-locale.yml @@ -0,0 +1,10 @@ +bugfixes: + - bzr - 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/11785). + - lldp - 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/11785). + - ohai - 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/11785). diff --git a/plugins/modules/bzr.py b/plugins/modules/bzr.py index 45efcf9d33..61f56a539b 100644 --- a/plugins/modules/bzr.py +++ b/plugins/modules/bzr.py @@ -147,6 +147,7 @@ def main(): executable=dict(type="str"), ) ) + module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"} dest = module.params["dest"] parent = module.params["name"] diff --git a/plugins/modules/lldp.py b/plugins/modules/lldp.py index 5aa9c11d44..03131f50f6 100644 --- a/plugins/modules/lldp.py +++ b/plugins/modules/lldp.py @@ -95,6 +95,7 @@ def gather_lldp(module): def main(): module_args = dict(multivalues=dict(type="bool", default=False)) module = AnsibleModule(module_args) + module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"} lldp_output = gather_lldp(module) try: diff --git a/plugins/modules/ohai.py b/plugins/modules/ohai.py index 60865cb394..5005f141ed 100644 --- a/plugins/modules/ohai.py +++ b/plugins/modules/ohai.py @@ -38,6 +38,7 @@ from ansible.module_utils.basic import AnsibleModule def main(): module = AnsibleModule(argument_spec=dict()) + module.run_command_environ_update = {"LANGUAGE": "C", "LC_ALL": "C"} cmd = ["/usr/bin/env", "ohai"] rc, out, err = module.run_command(cmd, check_rc=True) module.exit_json(**json.loads(out))