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
rabbitmq_user: Specify key to use while sorting permissions #49126
Conversation
Without specifying the dictionary key to use while sorting it will fail in Python 3 environments due to simplifying Python's rules for ordering comparisons: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
Hi @groggi, thank you for submitting this pull-request! |
@windowsrefund Could you please test this patch? @groggi Given your comment #49120 (comment) does this need further work/testing? |
This patch does not cover the issue of the module being idempotent. It only resolves the original Python exception mentioned in #49120. I'm not sure how quickly I'll get to identifying and resolving the idempotency issue. It might make sense to resolve #49120 with this patch and open an independent issue to track the idempotency of the module (as was identified by @windowsrefund #49120 (comment)). Let me know if I should create another bug report or if we should track it as part of #49120. |
@groggi Given the above, I'll merge this as it's an improvement over what we have today. Whatever works for you is fine :) |
Merged into |
@groggi oh, your first pull request, MERGED, congratulations! |
@gundalow thank you a lot! |
@groggi If you search for |
Without specifying the dictionary key to use while sorting it will fail in Python 3 environments due to simplifying Python's rules for ordering comparisons: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
SUMMARY
Without specifying the dictionary key to use while sorting it will fail
in Python 3 environments due to simplifying Python's rules for ordering
comparisons: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
Fixes #49120
ISSUE TYPE
COMPONENT NAME
rabbitmq_user
ADDITIONAL INFORMATION
The basic idea is to use the
vhost
dictionary key for sorting, which should be unique in the list according to https://www.rabbitmq.com/access-control.html#permissions ("Permissions are expressed as a triple of regular expressions - one each for configure, write and read - on per-vhost basis.").I didn't find a unit test file I could extend, so no tests added. Please let me know if I just didn't look hard enough.
My Python is a bit rusty, so please let me know if I can improve it or feel free to base a new patch for #49120 on it.