Bug 799375 - Command 'rhc domain destroy' and a non-existing domain: return code 0
Summary: Command 'rhc domain destroy' and a non-existing domain: return code 0
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-02 15:36 UTC by Attila Nagy
Modified: 2015-05-15 01:47 UTC (History)
3 users (show)

Fixed In Version: rhc-0.87.8-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-05 17:54:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Attila Nagy 2012-03-02 15:36:30 UTC
Description of problem: When I try to destroy a domain with command 'rhc domain destroy' and the domain dosn't exist, the command reports error however the return code is 0.

$ rhc domain destroy -n NONEXISTING $U
Problem reported from server. Response code was 400.
Re-run with -d for more information.

RESULT:
Cannot alter or remove namespace NONEXISTING. Namspace does not exist.

$ echo $?
0


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


How reproducible: Always


Steps to Reproduce:
1. rhc domain destroy -n NONEXISTING 
2. echo $?


Actual results: Error is reported, but the return code is 0


Expected results: Return code must be different than 0


Additional info:

Comment 1 Abhishek Gupta 2012-03-02 20:43:24 UTC
This has now been fixed.

Comment 2 Linqing Lu 2012-03-05 07:19:35 UTC
tested on stage and devenv_1652
still returns 0.

--------------------------------

[root@localhost ~]# rhc domain destroy -n aaaaaaa
Password: 
Problem reported from server. Response code was 400.
Re-run with -d for more information.

RESULT:
Cannot alter or remove namespace aaaaaaa. Namspace does not exist.

[root@localhost ~]# echo $?
0

Comment 3 Linqing Lu 2012-03-05 08:01:01 UTC
(In reply to comment #2)
> tested on stage and devenv_1652
> still returns 0.
> 
> --------------------------------
> 
> [root@localhost ~]# rhc domain destroy -n aaaaaaa
> Password: 
> Problem reported from server. Response code was 400.
> Re-run with -d for more information.
> 
> RESULT:
> Cannot alter or remove namespace aaaaaaa. Namspace does not exist.
> 
> [root@localhost ~]# echo $?
> 0

correction: it returns 1 on devenv_1652, still returns 0 on stage.

Comment 4 Linqing Lu 2012-03-05 08:08:10 UTC
verified on devenv_1652
it returns 1 now.


Note You need to log in before you can comment on or make changes to this bug.