-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
Hello,
The idempotency of this API call is not working properly: https://github.com/IBM-Security/ibmsecurity/blob/master/ibmsecurity/isam/base/audit_configuration.py
The issue being that the json_compare is often providing back false due to the misalignment between the config lists.
To solve this problem, the following _check method does the sorting:
- At the top, add:
from operator import itemgetter- In the check method, replace:
"config": config,by
"config": sorted(config, key=itemgetter('key'))- And add it as well later in the retrieved config:
aud_cfg['config'] = sorted(aud_cfg['config'], key=itemgetter('key'))These changes will make sure that both lists are sorted on the 'key' element prior comparing them.
Cédric Servais
Metadata
Metadata
Assignees
Labels
No labels