keycloak_client: remove code that turns attributes dict into list (#9077)
* 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 <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>pull/9145/head
parent
195ae4afde
commit
62cb6087b5
|
@ -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).
|
|
@ -805,9 +805,6 @@ def normalise_cr(clientrep, remove_ids=False):
|
||||||
# Avoid the dict passed in to be modified
|
# Avoid the dict passed in to be modified
|
||||||
clientrep = clientrep.copy()
|
clientrep = clientrep.copy()
|
||||||
|
|
||||||
if 'attributes' in clientrep:
|
|
||||||
clientrep['attributes'] = list(sorted(clientrep['attributes']))
|
|
||||||
|
|
||||||
if 'defaultClientScopes' in clientrep:
|
if 'defaultClientScopes' in clientrep:
|
||||||
clientrep['defaultClientScopes'] = list(sorted(clientrep['defaultClientScopes']))
|
clientrep['defaultClientScopes'] = list(sorted(clientrep['defaultClientScopes']))
|
||||||
|
|
||||||
|
@ -1024,13 +1021,6 @@ def main():
|
||||||
for client_param in client_params:
|
for client_param in client_params:
|
||||||
new_param_value = module.params.get(client_param)
|
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
|
# Unfortunately, the ansible argument spec checker introduces variables with null values when
|
||||||
# they are not specified
|
# they are not specified
|
||||||
if client_param == 'protocol_mappers':
|
if client_param == 'protocol_mappers':
|
||||||
|
|
Loading…
Reference in New Issue