Skip to content

Commit 6777d94

Browse files
[PR #8831/2ae41fa8 backport][stable-8] keycloak_user_federation: get the before mappers from before_comp to fix UnboundLocalError (#8849)
keycloak_user_federation: get the before mappers from `before_comp` to fix `UnboundLocalError` (#8831) * fix: get the before mappers from `before_comp` * add changelog fragment * Adjust changelog fragment. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 2ae41fa) Co-authored-by: fgruenbauer <[email protected]>
1 parent 61ea1ae commit 6777d94

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- keycloak_user_federation - fix the ``UnboundLocalError`` that occurs when an ID is provided for a user federation mapper (https://github.com/ansible-collections/community.general/pull/8831).

plugins/modules/keycloak_user_federation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ def main():
892892
if cid is None:
893893
old_mapper = {}
894894
elif change.get('id') is not None:
895-
old_mapper = next((before_mapper for before_mapper in before_mapper.get('mappers', []) if before_mapper["id"] == change['id']), None)
895+
old_mapper = next((before_mapper for before_mapper in before_comp.get('mappers', []) if before_mapper["id"] == change['id']), None)
896896
if old_mapper is None:
897897
old_mapper = {}
898898
else:

0 commit comments

Comments
 (0)