Bug 906124 - exit code from "rct --help" and "subscription-manager --help" should be zero
exit code from "rct --help" and "subscription-manager --help" should be zero
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.10
Unspecified Unspecified
unspecified Severity low
: beta
: 5.10
Assigned To: Bryan Kearney
IDM QE LIST
: Regression, Reopened, TestBlocker
Depends On:
Blocks: rhsm-rhel510 rhsm-2013
  Show dependency treegraph
 
Reported: 2013-01-30 17:14 EST by John Sefler
Modified: 2013-10-01 09:51 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-01 09:51:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2013-01-30 17:14:29 EST
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 17:22:09 EST
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 15:11:00 EST

*** This bug has been marked as a duplicate of bug 873601 ***
Comment 6 Bryan Kearney 2013-02-11 11:31:42 EST
commit ff54a2877367e3a50ecf4e768f62649b69857c07
Author: Bryan Kearney <bkearney@redhat.com>
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 11:17:04 EST
(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 15:21:53 EDT
# 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

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