1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

nmcli: Remove dead code, 'options' never contains keys from 'param_alias' (#2417)

* nmcli: Remove dead code, 'options' never contains keys from 'param_alias'

* Update changelogs/fragments/2417-nmcli_remove_dead_code.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
spike77453 2021-05-11 19:35:30 +02:00 committed by GitHub
parent 0912e8cc7a
commit b9fa9116c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 18 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- nmcli - remove dead code, ``options`` never contains keys from ``param_alias`` (https://github.com/ansible-collections/community.general/pull/2417).

View file

@ -1036,17 +1036,6 @@ class Nmcli(object):
return conn_info
def _compare_conn_params(self, conn_info, options):
# See nmcli(1) for details
param_alias = {
'type': 'connection.type',
'con-name': 'connection.id',
'autoconnect': 'connection.autoconnect',
'ifname': 'connection.interface-name',
'master': 'connection.master',
'slave-type': 'connection.slave-type',
'zone': 'connection.zone',
}
changed = False
diff_before = dict()
diff_after = dict()
@ -1070,13 +1059,6 @@ class Nmcli(object):
value = value.upper()
# ensure current_value is also converted to uppercase in case nmcli changes behaviour
current_value = current_value.upper()
elif key in param_alias:
real_key = param_alias[key]
if real_key in conn_info:
current_value = conn_info[real_key]
else:
# alias parameter does not exist
current_value = None
else:
# parameter does not exist
current_value = None