Skip to content

Commit

Permalink
radosgw_user: handle non-existence user on check mode
Browse files Browse the repository at this point in the history
Set return code to 0 on check mode when the user doesn't exists and it will fail the module.

Signed-off-by: Seena Fallah <[email protected]>
(cherry picked from commit 878cce5)
  • Loading branch information
clwluvw authored and mergify[bot] committed May 6, 2024
1 parent bbf055d commit 8638d40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/radosgw_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,11 @@ def run_module():
if changed and not module.check_mode:
rc, cmd, out, err = exec_commands(module, modify_user(module, container_image=container_image)) # noqa: E501
else:
changed = True
if not module.check_mode:
rc, cmd, out, err = exec_commands(module, create_user(module, container_image=container_image)) # noqa: E501
changed = True
else:
rc = 0

elif state == "absent":
if rc == 0:
Expand Down

0 comments on commit 8638d40

Please sign in to comment.