diff --git a/changelogs/fragments/netconf_module_utils_py3_fix.yaml b/changelogs/fragments/netconf_module_utils_py3_fix.yaml new file mode 100644 index 00000000000..cc8d8670a5f --- /dev/null +++ b/changelogs/fragments/netconf_module_utils_py3_fix.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: +- netconf_config - Fix netconf module_utils dict changed size issue (https://github.com/ansible/ansible/pull/46778) diff --git a/lib/ansible/module_utils/network/netconf/netconf.py b/lib/ansible/module_utils/network/netconf/netconf.py index cf25adc3bdb..f612142b60f 100644 --- a/lib/ansible/module_utils/network/netconf/netconf.py +++ b/lib/ansible/module_utils/network/netconf/netconf.py @@ -131,7 +131,7 @@ def sanitize_xml(data): # remove attributes attribute = element.attrib if attribute: - for key in attribute: + for key in list(attribute): if key not in IGNORE_XML_ATTRIBUTE: attribute.pop(key) return to_text(tostring(tree), errors='surrogate_then_replace').strip()