Bug 906124

Summary: exit code from "rct --help" and "subscription-manager --help" should be zero
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.10CC: bkearney, fsharath, jgalipea
Target Milestone: betaKeywords: Regression, Reopened, TestBlocker
Target Release: 5.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 13:51:01 UTC 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:
Bug Depends On:    
Bug Blocks: 840995, 920191    

Description John Sefler 2013-01-30 22:14:29 UTC
Description of problem:
zero is considered “successful termination” and any nonzero value is considered “abnormal termination”

Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# rpm -q subscription-manager python
subscription-manager-1.8.1-1.git.2.23579a5.el7.x86_64
python-2.7.3-13.el7.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-7 ~]# rct --help
Usage: rct MODULE-NAME [MODULE-OPTIONS] [--help]

Primary Modules:

  cat-cert       Print certificate information
  cat-manifest   Print manifest information
  dump-manifest  Dump the contents of a manifest
  stat-cert      Print certificate statistics and sizes

[root@jsefler-7 ~]# echo $?
1



Actual results:
1

Expected results:
0

Comment 1 John Sefler 2013-01-30 22:22:09 UTC
Same unexpected exit code is coming from "subscription-manager --help"

[root@jsefler-7 ~]# subscription-manager -h 1>/dev/null
[root@jsefler-7 ~]# echo $?
1

Comment 4 Bryan Kearney 2013-02-08 20:11:00 UTC

*** This bug has been marked as a duplicate of bug 873601 ***

Comment 6 Bryan Kearney 2013-02-11 16:31:42 UTC
commit ff54a2877367e3a50ecf4e768f62649b69857c07
Author: Bryan Kearney <bkearney>
Date:   Fri Feb 8 15:52:04 2013 -0500

    906214: rct --help should return 0.
    
    The logic implemented should do the following:
    
    subscription-manager => return code 1
    subscription-manager --some_invalid_valeu => return code 1
    susbcription-manager --help => return code 0

Comment 7 John Sefler 2013-02-12 16:17:04 UTC
(In reply to comment #1)
> Same unexpected exit code is coming from "subscription-manager --help"
> 
> [root@jsefler-7 ~]# subscription-manager -h 1>/dev/null
> [root@jsefler-7 ~]# echo $?
> 1

CORRECTION: the exit code above is actually the correct exit code because "-h" is not a valid recognized command line option.

However, the following with "--help" is indeed an unexpected exit code; expected 0.
[root@jsefler-7 ~]# subscription-manager --help 1>/dev/null
[root@jsefler-7 ~]# echo $?
1

Comment 8 Sharath Dwaral 2013-03-11 19:21:53 UTC
# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-firstboot-1.8.4-1.el7.x86_64
python-rhsm-1.8.7-1.el7.x86_64
subscription-manager-gui-1.8.4-1.el7.x86_64
subscription-manager-migration-1.8.4-1.el7.x86_64
subscription-manager-1.8.4-1.el7.x86_64
subscription-manager-debuginfo-1.8.4-1.el7.x86_64


# rct --help 1>/dev/null
# echo $?
0

# subscription-manager --help 1>/dev/null
# echo $?
0


VERIFIED