From e6f7ef7f56779a1235679dff216469ec05aef35c Mon Sep 17 00:00:00 2001 From: Seena Fallah Date: Wed, 24 Apr 2024 18:59:48 +0200 Subject: [PATCH] radosgw_user: handle non-existence user on check mode 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 (cherry picked from commit 878cce5b4847a9a112f9d07c0fd651aa15f1e58b) --- library/radosgw_user.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/radosgw_user.py b/library/radosgw_user.py index 2370a4ddd4..78addd0cd7 100644 --- a/library/radosgw_user.py +++ b/library/radosgw_user.py @@ -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: