Skip to content

Commit

Permalink
keycloak_clientscope: remove code turning attributes dict into list (#…
Browse files Browse the repository at this point in the history
…9082)

* remove code turning attributes dict into list

* add changelog fragment
  • Loading branch information
fgruenbauer authored Nov 11, 2024
1 parent 62cb608 commit d27d86e
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_clientscope - fix diff and ``end_state`` by removing the code that turns the attributes dict, which contains additional config items, into a list (https://github.com/ansible-collections/community.general/pull/9082).
10 changes: 0 additions & 10 deletions plugins/modules/keycloak_clientscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ def normalise_cr(clientscoperep, remove_ids=False):
# Avoid the dict passed in to be modified
clientscoperep = clientscoperep.copy()

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

if 'protocolMappers' in clientscoperep:
clientscoperep['protocolMappers'] = sorted(clientscoperep['protocolMappers'], key=lambda x: (x.get('name'), x.get('protocol'), x.get('protocolMapper')))
for mapper in clientscoperep['protocolMappers']:
Expand Down Expand Up @@ -418,13 +415,6 @@ def main():
for clientscope_param in clientscope_params:
new_param_value = module.params.get(clientscope_param)

# some lists in the Keycloak API are sorted, some are not.
if isinstance(new_param_value, list):
if clientscope_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 clientscope_param == 'protocol_mappers':
Expand Down

0 comments on commit d27d86e

Please sign in to comment.