diff --git a/changelogs/fragments/1527-fix-nios-api-member-normalize.yaml b/changelogs/fragments/1527-fix-nios-api-member-normalize.yaml new file mode 100644 index 0000000000..4e4720487c --- /dev/null +++ b/changelogs/fragments/1527-fix-nios-api-member-normalize.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - nios_member - fix Python 3 compatibility with nios api ``member_normalize`` function (https://github.com/ansible-collections/community.general/issues/1526). diff --git a/plugins/module_utils/net_tools/nios/api.py b/plugins/module_utils/net_tools/nios/api.py index b01a54a400..6cded8e1c8 100644 --- a/plugins/module_utils/net_tools/nios/api.py +++ b/plugins/module_utils/net_tools/nios/api.py @@ -144,7 +144,7 @@ def member_normalize(member_spec): 'pre_provisioning', 'network_setting', 'v6_network_setting', 'ha_port_setting', 'lan_port_setting', 'lan2_physical_setting', 'lan_ha_port_setting', 'mgmt_network_setting', 'v6_mgmt_network_setting'] - for key in member_spec.keys(): + for key in list(member_spec.keys()): if key in member_elements and member_spec[key] is not None: member_spec[key] = member_spec[key][0] if isinstance(member_spec[key], dict):