Bug 773176

Summary: unexpected exit code when remove ssh key with non-existing key name
Product: OKD Reporter: Meng Bo <bmeng>
Component: ContainersAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.xCC: dmcphers
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-30 04:59:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Meng Bo 2012-01-11 06:35:15 UTC
Description of problem:
"rhc-ctl-domain -r $keyname" will return exit code 0 with operation successfully, whatever the key name is, even non-existing one.

Version-Release number of selected component (if applicable):
rhc-broker-0.84.37-1.el6_2.noarch 

How reproducible:
always

Steps to Reproduce:
1.create a domain with exist ssh key pair.
2.generate another ssh key via ssh-keygen
3.add the new ssh key to the domain
# rhc-ctl-domain -a newkey1 -k ~/.ssh/libra_id_rsa_new.pub
4.try to remove the ssh key with non-exist key name
# rhc-ctl-domain -r testtest

  
Actual results:
it will return a success with exit code 0, and nothing removed.

Expected results:
it should be prompt some error message like 'key name does not exist' and return operation failed.


Additional info:
keytest is a non-exist ssh key name.

[root@localhost .ssh]# rhc-ctl-domain --remove-ssh-key keytest -d
Password: 
Submitting form:
action: remove-key
key_name: keytest
rhlogin: bmeng+1
Contacting https://ec2-107-21-79-175.compute-1.amazonaws.com
Response from server:
DEBUG:


Exit Code: 0
broker_c: namespacerhloginsshapp_uuiddebugaltercartridgecart_typeactionapp_nameapi
api_c: placeholder
API version:    1.1.1
Broker version: 1.1.1
Success

Comment 1 Ravi Sankar 2012-01-11 17:55:01 UTC
Fixed

Comment 2 Meng Bo 2012-01-12 04:49:27 UTC
verified with rhc-0.84.11-1.el6_2.noarch,on devenv-stage_112
bug fixed.