mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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>
This commit is contained in:
parent
c84fb5577b
commit
b79ac4f0ac
2 changed files with 3 additions and 1 deletions
|
@ -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).
|
|
@ -1004,7 +1004,7 @@ def main():
|
||||||
|
|
||||||
for before_mapper in before_comp.get('mappers', []):
|
for before_mapper in before_comp.get('mappers', []):
|
||||||
# remove unwanted existing mappers that will not be updated
|
# 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)
|
kc.delete_component(before_mapper['id'], realm)
|
||||||
|
|
||||||
for mapper in desired_mappers:
|
for mapper in desired_mappers:
|
||||||
|
|
Loading…
Reference in a new issue