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 #4932pull/4940/head
parent
905f9ec399
commit
9a928d5ffb
|
@ -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 New Issue