From 58aaf532716ca6b662fc015d694c108767d254bb Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Thu, 11 Oct 2018 00:01:17 +0530 Subject: [PATCH] Fix netconf module_utils dict changed size issue (#46778) Fixes #46755 Use list() to copy the keys of attribute dict while iterating over attribute dict. --- lib/ansible/module_utils/network/netconf/netconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()