Bug 2042384

Summary: [rbd-mirror] : [negative scenario] peer remove returns 0 even for non existing peer uuid
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Vasishta <vashastr>
Component: RBD-MirrorAssignee: Ilya Dryomov <idryomov>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.3CC: ceph-eng-bugs, choffman, jdurgin
Target Milestone: ---   
Target Release: 8.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 2022-01-19 11:57:07 UTC
Description of problem: [negative scenario]
rbd mirror pool peer remove returns 0 even for non existing peer's uuid

Version-Release number of selected component (if applicable):
14.2.22-49.el7cp

How reproducible:
Tried twice, faced twice

Steps to Reproduce: [negative scenario]
1. Configure rbd mirroring
2. try to remove non-existing peer's uuid and observe that command returns 0

Actual results:
Command returns zero even for non-existing peer is tried to be removed

# sudo rbd mirror pool peer remove test a-b-c-d
rbd: invalid uuid 'a-b-c-d'
# sudo rbd mirror pool peer remove test aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
# echo $?
0
[root@DELL-R640-091 ~]# sudo rbd mirror pool info test
Mode: image
Site Name: site_a

Peer Sites: none

Expected results:
Command should error out saying there are no peers added with <uuid>