keycloak_clientscope: remove code turning attributes dict into list (#9082)

* remove code turning attributes dict into list

* add changelog fragment
pull/9145/head
fgruenbauer 2024-11-11 20:02:41 +01:00 committed by GitHub
parent 62cb6087b5
commit d27d86ecb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 10 deletions

View File

@ -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).

View File

@ -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']:
@ -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':