diff options
author | Martin Nečas <necas.marty@gmail.com> | 2019-11-05 14:22:17 +0100 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2019-11-05 08:22:17 -0500 |
commit | d9f5be8d0d8a036aaa89056536f58b4a2e3c86b5 (patch) | |
tree | 6cda34e970fd8261a5b192d8a685ce568b9ce674 /lib/ansible/modules | |
parent | 484943cbd1729fb8e82b9d98619a4246f8811178 (diff) | |
download | ansible-d9f5be8d0d8a036aaa89056536f58b4a2e3c86b5.tar.gz |
Ovirt host network dict correct (#64437)
* ovirt_host_network: correct comparing of two dicts
* update mode_number for 4th option
Diffstat (limited to 'lib/ansible/modules')
-rw-r--r-- | lib/ansible/modules/cloud/ovirt/ovirt_host_network.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py b/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py index b051e3079d..e6d741adbd 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py @@ -214,7 +214,7 @@ def get_bond_options(mode, usr_opts): None, 'Dynamic link aggregation (802.3ad)', ] - if (not 0 < mode_number <= len(modes) - 1): + if (not 0 < mode_number <= len(modes)): return None return modes[mode_number - 1] @@ -245,7 +245,9 @@ def get_bond_options(mode, usr_opts): class HostNetworksModule(BaseModule): def __compare_options(self, new_options, old_options): - return sorted(get_dict_of_struct(opt) for opt in new_options) != sorted(get_dict_of_struct(opt) for opt in old_options) + return sorted((get_dict_of_struct(opt) for opt in new_options), + key=lambda x: x["name"]) != sorted((get_dict_of_struct(opt) for opt in old_options), + key=lambda x: x["name"]) def build_entity(self): return otypes.Host() |