Bug 2004909

Summary: rbd mirror snapshot schedule rm returns 0 when tried to remove non-existent schedule
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Vasishta <vashastr>
Component: RBD-MirrorAssignee: Christopher Hoffman <choffman>
Status: ASSIGNED --- QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.0CC: ceph-eng-bugs, choffman, idryomov, sostapov, vereddy
Target Milestone: ---   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vasishta 2021-09-16 12:09:16 UTC
Description of problem:
rbd mirror snapshot schedule rm returns 0 when tried to remove non-existent schedule

this decreases usability, if a user makes any typo in his command, he wouldn't get to know that there has been some mishap and he wouldn't be achieving what exactly he wished to achieve.

Version-Release number of selected component (if applicable):
16.2.0-117.el8cp

How reproducible:
Always

Steps to Reproduce:
1. Create two clusters with rbd snapshot based mirroring enabled
2. Try to delete non-existent schedule

Actual results:
[ceph: root@magna008 /]# rbd mirror snapshot schedule ls -p two_way --recursive
POOL     NAMESPACE  IMAGE  SCHEDULE          
two_way  -          -      every 1h, every 6h
[ceph: root@magna008 /]# rbd mirror snapshot schedule rm  --pool two_way --image image 7h
[ceph: root@magna008 /]# echo $?
0


Expected results:
Error message should be displayed if user tries to delete non existent schedule

Additional info: