mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #8831/2ae41fa8 backport][stable-9] keycloak_user_federation: get the before mappers from before_comp
to fix UnboundLocalError
(#8850)
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 <felix@fontein.de>
(cherry picked from commit 2ae41fa83f
)
Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
This commit is contained in:
parent
5f7a3ac896
commit
8d8fc3d3ba
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- 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).
|
|
@ -907,7 +907,7 @@ def main():
|
|||
if cid is None:
|
||||
old_mapper = {}
|
||||
elif change.get('id') is not None:
|
||||
old_mapper = next((before_mapper for before_mapper in before_mapper.get('mappers', []) if before_mapper["id"] == change['id']), None)
|
||||
old_mapper = next((before_mapper for before_mapper in before_comp.get('mappers', []) if before_mapper["id"] == change['id']), None)
|
||||
if old_mapper is None:
|
||||
old_mapper = {}
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue