Skip to content

Commit

Permalink
ceph-key: check for key existance on absent state
Browse files Browse the repository at this point in the history
check if the key is exists before removal.

Signed-off-by: Seena Fallah <[email protected]>
  • Loading branch information
clwluvw authored and guits committed May 21, 2024
1 parent 7016c6d commit 5236516
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/ceph_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,12 @@ def run_module():
changed = True

elif state == "absent":
if key_exist == 0:
rc, cmd, out, err = exec_commands(
module, info_key(cluster, name, user, user_key_path, output_format, container_image)) # noqa: E501
if rc == 0:
rc, cmd, out, err = exec_commands(
module, delete_key(cluster, user, user_key_path, name, container_image)) # noqa: E501
if rc == 0:
changed = True
changed = True
else:
rc = 0

Expand Down

0 comments on commit 5236516

Please sign in to comment.