1
0
Fork 0
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) (#4937)

* 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:
patchback[bot] 2022-07-07 22:37:10 +02:00 committed by GitHub
parent 3f4e3dd2b6
commit 6115f18837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View 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).

View file

@ -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)