1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

keycloak_user: avoid error when trying to delete a non-existing user (#7696)

* avoid error when trying to delete a non-existing user

when force is set, but the user doesn't exist yet, this fails.

* 7696-avoid-attempt-to-delete-non-existing-user

add changelog entry

* rename changelog file

* Update changelogs/fragments/7696-avoid-attempt-to-delete-non-existing-user.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Michiel Dethmers 2023-12-21 12:09:12 +00:00 committed by GitHub
parent 916f6f7c87
commit 1389bba459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- keycloak_user - when ``force`` is set, but user does not exist, do not try to delete it (https://github.com/ansible-collections/community.general/pull/7696).

View file

@ -481,7 +481,7 @@ def main():
else: else:
after_user = {} after_user = {}
if force: # If the force option is set to true if force and before_user: # If the force option is set to true
# Delete the existing user # Delete the existing user
kc.delete_user(user_id=before_user["id"], realm=realm) kc.delete_user(user_id=before_user["id"], realm=realm)