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.
This commit is contained in:
parent
32397531d0
commit
58aaf53271
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ def sanitize_xml(data):
|
||||||
# remove attributes
|
# remove attributes
|
||||||
attribute = element.attrib
|
attribute = element.attrib
|
||||||
if attribute:
|
if attribute:
|
||||||
for key in attribute:
|
for key in list(attribute):
|
||||||
if key not in IGNORE_XML_ATTRIBUTE:
|
if key not in IGNORE_XML_ATTRIBUTE:
|
||||||
attribute.pop(key)
|
attribute.pop(key)
|
||||||
return to_text(tostring(tree), errors='surrogate_then_replace').strip()
|
return to_text(tostring(tree), errors='surrogate_then_replace').strip()
|
||||||
|
|
Loading…
Reference in a new issue