mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-21 03:09:04 +00:00
[PR #11742/bdd31745 backport][stable-12] nmcli: use get_best_parsable_locale() to support UTF-8 connection names (#11757)
nmcli: use get_best_parsable_locale() to support UTF-8 connection names (#11742)
* nmcli: start locale fix - normalize run_command environ to LANGUAGE=C, LC_ALL=C
Work in progress - issue #10384 (UTF-8 conn_name support) requires deeper
investigation beyond simple locale variable normalization.
* nmcli: use get_best_parsable_locale() to support UTF-8 connection names
Fixes issue where UTF-8 connection names (e.g. Chinese characters) were
corrupted to '????' when LC_ALL=C forced ASCII encoding, causing
connection_exists() to always return False for non-ASCII names.
* add changelog fragment for PR #11742
---------
(cherry picked from commit bdd3174563)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e5f9516335
commit
04367d8b9c
3 changed files with 12 additions and 1 deletions
|
|
@ -1652,6 +1652,9 @@ def mocker_set(
|
|||
"""
|
||||
Common mocker object
|
||||
"""
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.modules.nmcli.get_best_parsable_locale", return_value="C"
|
||||
)
|
||||
get_bin_path = mocker.patch("ansible.module_utils.basic.AnsibleModule.get_bin_path")
|
||||
get_bin_path.return_value = "/usr/bin/nmcli"
|
||||
connection = mocker.patch.object(nmcli.Nmcli, "connection_exists")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue