-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix code in rax_clb_nodes
that breaks in Python3
#4933
Fix code in rax_clb_nodes
that breaks in Python3
#4933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Could you please add a changelog fragment? Thanks.
931f53d
to
f4640f1
Compare
rax_clb_nodes
that breaks in Python3rax_clb_nodes
that breaks in Python3
* 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 ansible-collections#4932
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #4936 🤖 @patchback |
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #4937 🤖 @patchback |
@tcaddy thanks for fixing this! |
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
SUMMARY
Fix syntax in
rax_clb_nodes
that breaks in Python3dict that's going to be mutated during iteration
dictionary changed size during iteration
errorcommunity.general.rax_clb_nodes
not working with python3 #4932ISSUE TYPE
COMPONENT NAME
community.general.rax_clb_nodes
defined here: https://github.com/ansible-collections/community.general/blob/main/plugins/modules/cloud/rackspace/rax_clb_nodes.pyADDITIONAL INFORMATION
Prior to this change, you are unable to run the
rax_clb_nodes
task against hosts that only have Python 3 installed. You would get this error:RuntimeError: dictionary changed size during iteration
Now it works as expected under hosts with Python 2 or Python 3.