mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
keycloak_clientscope_type: sort default and optional clientscope lists before diff (#9202)
* sort default and optional clientscope lists before diff * add changelog fragment
This commit is contained in:
parent
a789bd128f
commit
55d714da81
2 changed files with 12 additions and 1 deletions
|
@ -190,6 +190,15 @@ def extract_field(dictionary, field='name'):
|
|||
return [cs[field] for cs in dictionary]
|
||||
|
||||
|
||||
def normalize_scopes(scopes):
|
||||
scopes_copy = scopes.copy()
|
||||
if isinstance(scopes_copy.get('default_clientscopes'), list):
|
||||
scopes_copy['default_clientscopes'] = sorted(scopes_copy['default_clientscopes'])
|
||||
if isinstance(scopes_copy.get('optional_clientscopes'), list):
|
||||
scopes_copy['optional_clientscopes'] = sorted(scopes_copy['optional_clientscopes'])
|
||||
return scopes_copy
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
Module keycloak_clientscope_type
|
||||
|
@ -244,7 +253,7 @@ def main():
|
|||
})
|
||||
|
||||
if module._diff:
|
||||
result['diff'] = dict(before=result['existing'], after=result['proposed'])
|
||||
result['diff'] = dict(before=normalize_scopes(result['existing']), after=normalize_scopes(result['proposed']))
|
||||
|
||||
default_clientscopes_add = clientscopes_to_add(default_clientscopes_existing, default_clientscopes_real)
|
||||
optional_clientscopes_add = clientscopes_to_add(optional_clientscopes_existing, optional_clientscopes_real)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue