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.
(cherry picked from commit 58aaf53271
)
Update Changelog
This commit is contained in:
parent
c888058973
commit
42183e562a
2 changed files with 4 additions and 1 deletions
3
changelogs/fragments/netconf_module_utils_py3_fix.yaml
Normal file
3
changelogs/fragments/netconf_module_utils_py3_fix.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- netconf_config - Fix netconf module_utils dict changed size issue (https://github.com/ansible/ansible/pull/46778)
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue