mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
[PR #9880/3922b82a backport][stable-9] nmcli: fix reordering of DNS nameservers and search suffixes (#9911)
nmcli: fix reordering of DNS nameservers and search suffixes (#9880)
* nmcli: fix reordering of DNS nameservers and search suffixes
- Fixes #8724
* Update changelog fragment index in line with PR number
- Now I understand what that number is for
* Use correct changelog format for nmcli PR #9880
(cherry picked from commit 3922b82a57)
Co-authored-by: ashleyghooper <ashleyghooper@gmail.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "nmcli - enable changing only the order of DNS servers or search suffixes (https://github.com/ansible-collections/community.general/issues/8724, https://github.com/ansible-collections/community.general/pull/9880)."
|
||||||
@@ -2416,9 +2416,11 @@ class Nmcli(object):
|
|||||||
|
|
||||||
if isinstance(current_value, list) and isinstance(value, list):
|
if isinstance(current_value, list) and isinstance(value, list):
|
||||||
# compare values between two lists
|
# compare values between two lists
|
||||||
if key in ('ipv4.addresses', 'ipv6.addresses'):
|
if key in ('ipv4.addresses', 'ipv6.addresses', 'ipv4.dns', 'ipv6.dns', 'ipv4.dns-search', 'ipv6.dns-search'):
|
||||||
# The order of IP addresses matters because the first one
|
# The order of IP addresses matters because the first one
|
||||||
# is the default source address for outbound connections.
|
# is the default source address for outbound connections.
|
||||||
|
# Similarly, the order of DNS nameservers and search
|
||||||
|
# suffixes is important.
|
||||||
changed |= current_value != value
|
changed |= current_value != value
|
||||||
else:
|
else:
|
||||||
changed |= sorted(current_value) != sorted(value)
|
changed |= sorted(current_value) != sorted(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user