mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
44009a72d3
commit
07798c3169
2 changed files with 4 additions and 1 deletions
2
changelogs/fragments/4933-fix-rax-clb-nodes.yaml
Normal file
2
changelogs/fragments/4933-fix-rax-clb-nodes.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- rax_clb_nodes - fix code to be compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/4933).
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue