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()