Skip to content
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

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

tcaddy
Copy link
Contributor

@tcaddy tcaddy commented Jul 6, 2022

SUMMARY

Fix syntax in rax_clb_nodes that breaks in Python3

ISSUE TYPE
  • Bugfix Pull Request
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.py

ADDITIONAL 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.

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Jul 6, 2022
Copy link
Collaborator

@felixfontein felixfontein left a 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.

plugins/modules/cloud/rackspace/rax_clb_nodes.py Outdated Show resolved Hide resolved
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-4 labels Jul 6, 2022
@tcaddy tcaddy force-pushed the rax_clb_nodes_fix branch 2 times, most recently from 931f53d to f4640f1 Compare July 6, 2022 22:19
@ansibullbot ansibullbot removed the small_patch Hopefully easy to review label Jul 6, 2022
@felixfontein felixfontein changed the title Fix syntax in rax_clb_nodes that breaks in Python3 Fix code in rax_clb_nodes that breaks in Python3 Jul 7, 2022
  * 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
@felixfontein felixfontein merged commit 9a928d5 into ansible-collections:main Jul 7, 2022
@patchback
Copy link

patchback bot commented Jul 7, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/9a928d5ffb9e08f0f9ba10376058563a7fff8f22/pr-4933

Backported as #4936

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jul 7, 2022
patchback bot pushed a commit that referenced this pull request Jul 7, 2022
* 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 9a928d5)
@patchback
Copy link

patchback bot commented Jul 7, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/9a928d5ffb9e08f0f9ba10376058563a7fff8f22/pr-4933

Backported as #4937

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@tcaddy thanks for fixing this!

patchback bot pushed a commit that referenced this pull request Jul 7, 2022
* 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 9a928d5)
@github-actions
Copy link

github-actions bot commented Jul 7, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

felixfontein pushed a commit that referenced this pull request Jul 7, 2022
* 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 9a928d5)

Co-authored-by: Teddy Caddy <tcaddy@users.noreply.github.com>
This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

community.general.rax_clb_nodes not working with python3
3 participants