[PR #9691/41caa9a2 backport][stable-10] keycloak module utils replace missing return in `get_role_composites` (#9703)

keycloak module utils replace missing return in `get_role_composites` (#9691)

* fix: replace missing return (#9678)

* chore: add changelog fragment (#9678)

* chore: update changelog fragment (#9678)

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 41caa9a22c)

Co-authored-by: Mark Armstrong <markparmstrong@gmail.com>
pull/9709/head
patchback[bot] 2025-02-08 21:46:52 +01:00 committed by GitHub
parent 07e4e4a782
commit 3c77c8ec3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- keycloak module utils - replaces missing return in get_role_composites method which caused it to return None instead of composite roles (https://github.com/ansible-collections/community.general/issues/9678, https://github.com/ansible-collections/community.general/pull/9691).

View File

@ -1856,7 +1856,7 @@ class KeycloakAPI(object):
else: else:
composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"], safe='')) composite_url = URL_REALM_ROLE_COMPOSITES.format(url=self.baseurl, realm=realm, name=quote(rolerep["name"], safe=''))
# Get existing composites # Get existing composites
self._request_and_deserialize(composite_url, method='GET') return self._request_and_deserialize(composite_url, method='GET')
except Exception as e: except Exception as e:
self.fail_request(e, msg='Could not get role %s composites in realm %s: %s' self.fail_request(e, msg='Could not get role %s composites in realm %s: %s'
% (rolerep['name'], realm, str(e))) % (rolerep['name'], realm, str(e)))