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

[PR #7696/1389bba4 backport][stable-7] keycloak_user: avoid error when trying to delete a non-existing user (#7755)

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>
(cherry picked from commit 1389bba459)

Co-authored-by: Michiel Dethmers <michiel@phplist.com>
This commit is contained in:
patchback[bot] 2023-12-21 13:20:29 +01:00 committed by GitHub
parent 370fa9814a
commit f47fced4ca
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)