-
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
keycloak_client: avoid TypeError if result["attributes"]
is a list
#8403
keycloak_client: avoid TypeError if result["attributes"]
is a list
#8403
Conversation
result["attributes"]
is a list
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! Please add a changelog fragment. Thanks!
As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str
d9b82cb
to
7e641d5
Compare
@felixfontein I incorporated your suggestion and added a changelog fragment. Does this look good now? |
changelogs/fragments/8403-fix-typeerror-in-keycloak-client.yaml
Outdated
Show resolved
Hide resolved
Backport to stable-8: 💚 backport PR created✅ Backport PR branch: Backported as #8426 🤖 @patchback |
@thomasbach-dev thanks for fixing this! |
…8403) * fix(keycloak_client): avoid TypeError if attributes is a list As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 572caea)
Backport to stable-9: 💚 backport PR created✅ Backport PR branch: Backported as #8427 🤖 @patchback |
…8403) * fix(keycloak_client): avoid TypeError if attributes is a list As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 572caea)
…or if `result["attributes"]` is a list (#8426) keycloak_client: avoid TypeError if `result["attributes"]` is a list (#8403) * fix(keycloak_client): avoid TypeError if attributes is a list As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 572caea) Co-authored-by: Thomas Bach <63091663+thomasbach-dev@users.noreply.github.com>
…or if `result["attributes"]` is a list (#8427) keycloak_client: avoid TypeError if `result["attributes"]` is a list (#8403) * fix(keycloak_client): avoid TypeError if attributes is a list As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 572caea) Co-authored-by: Thomas Bach <63091663+thomasbach-dev@users.noreply.github.com>
…nsible-collections#8403) * fix(keycloak_client): avoid TypeError if attributes is a list As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de>
SUMMARY
This fixes a TypeError in the keycloak_client module.
Longer description:
As
sanitize_cr
might be executed afternormalise_cr
,result['attributes']
can be of type list and we run into:ISSUE TYPE
COMPONENT NAME
keycloak_client
ADDITIONAL INFORMATION
Full stack trace (keycloak_client.py got renamed to
mdz_keycloak_client.py
):