mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
* Use syntax that works in both Python 2 and 3 when iterating through a
dict that's going to be mutated during iteration
* Fixes `dictionary changed size during iteration` error
* Fixes #4932
(cherry picked from commit 9a928d5ffb)
Co-authored-by: Teddy Caddy <tcaddy@users.noreply.github.com>
This commit is contained in:
@@ -252,7 +252,8 @@ def main():
|
||||
'weight': weight,
|
||||
}
|
||||
|
||||
for name, value in mutable.items():
|
||||
for name in list(mutable):
|
||||
value = mutable[name]
|
||||
if value is None or value == getattr(node, name):
|
||||
mutable.pop(name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user