From e48083e66b3b2fa0695b6fc71c4fb33247a79a4a Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 29 Sep 2020 22:57:07 +0200 Subject: [PATCH] nmcli: set C locale when executing nmcli (#992) * Set C locale when calling nmcli. * Add changelog. --- changelogs/fragments/992-nmcli-locale.yml | 2 ++ plugins/modules/net_tools/nmcli.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/992-nmcli-locale.yml diff --git a/changelogs/fragments/992-nmcli-locale.yml b/changelogs/fragments/992-nmcli-locale.yml new file mode 100644 index 0000000000..599d795b12 --- /dev/null +++ b/changelogs/fragments/992-nmcli-locale.yml @@ -0,0 +1,2 @@ +bugfixes: +- "nmcli - set ``C`` locale when executing ``nmcli`` (https://github.com/ansible-collections/community.general/issues/989)." diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index f00befaed5..77893e6d4f 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -1760,6 +1760,7 @@ def main(): ), supports_check_mode=True, ) + module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C') if not HAVE_DBUS: module.fail_json(msg=missing_required_lib('dbus'), exception=DBUS_IMP_ERR)