1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #8762/b79ac4f0 backport][stable-9] keycloak_user_federation: fix key error when removing mappers in update (#8781)

keycloak_user_federation: fix key error when removing mappers in update (#8762)

* remove new mappers without an id from list comprehension

* add changelog fragment

* Update changelogs/fragments/8762-keycloac_user_federation-fix-key-error-when-updating.yml

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

---------

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

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
This commit is contained in:
patchback[bot] 2024-08-20 09:11:52 +02:00 committed by GitHub
parent e7024c3f97
commit 2f3d3aaf76
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_user_federation - fix key error when removing mappers during an update and new mappers are specified in the module args (https://github.com/ansible-collections/community.general/pull/8762).

View file

@ -1004,7 +1004,7 @@ def main():
for before_mapper in before_comp.get('mappers', []):
# remove unwanted existing mappers that will not be updated
if not before_mapper['id'] in [x['id'] for x in desired_mappers]:
if not before_mapper['id'] in [x['id'] for x in desired_mappers if 'id' in x]:
kc.delete_component(before_mapper['id'], realm)
for mapper in desired_mappers: