mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix syntax in rax_clb_nodes
that breaks in Python3 (#4933)
* 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
This commit is contained in:
parent
905f9ec399
commit
9a928d5ffb
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,
|
'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):
|
if value is None or value == getattr(node, name):
|
||||||
mutable.pop(name)
|
mutable.pop(name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue