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
Same unexpected exit code is coming from "subscription-manager --help" [root@jsefler-7 ~]# subscription-manager -h 1>/dev/null [root@jsefler-7 ~]# echo $? 1
*** This bug has been marked as a duplicate of bug 873601 ***
https://github.com/candlepin/subscription-manager/pull/496
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
(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
# 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