Skip to content

Commit

Permalink
keycloak_client: remove code that turns attributes dict into list (#9077
Browse files Browse the repository at this point in the history
)

* remove code that turns attributes dict into list

* add changelog fragment

* Update changelogs/fragments/9077-keycloak_client-fix-attributes-dict-turned-into-list.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
fgruenbauer and felixfontein authored Nov 11, 2024
1 parent 195ae4a commit 62cb608
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- keycloak_client - fix diff by removing code that turns the attributes dict which contains additional settings into a list (https://github.com/ansible-collections/community.general/pull/9077).
10 changes: 0 additions & 10 deletions plugins/modules/keycloak_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,6 @@ def normalise_cr(clientrep, remove_ids=False):
# Avoid the dict passed in to be modified
clientrep = clientrep.copy()

if 'attributes' in clientrep:
clientrep['attributes'] = list(sorted(clientrep['attributes']))

if 'defaultClientScopes' in clientrep:
clientrep['defaultClientScopes'] = list(sorted(clientrep['defaultClientScopes']))

Expand Down Expand Up @@ -1024,13 +1021,6 @@ def main():
for client_param in client_params:
new_param_value = module.params.get(client_param)

# some lists in the Keycloak API are sorted, some are not.
if isinstance(new_param_value, list):
if client_param in ['attributes']:
try:
new_param_value = sorted(new_param_value)
except TypeError:
pass
# Unfortunately, the ansible argument spec checker introduces variables with null values when
# they are not specified
if client_param == 'protocol_mappers':
Expand Down

0 comments on commit 62cb608

Please sign in to comment.