Bug 1136191

Summary: qpid-ha -h or --help should exit with returncode of 0
Product: Red Hat Enterprise MRG Reporter: Frantisek Reznicek <freznice>
Component: qpid-toolsAssignee: Alan Conway <aconway>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: low Docs Contact:
Priority: low    
Version: DevelopmentCC: esammons, iboverma, jross, zkraus
Target Milestone: 3.2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-tools-0.32-1 Doc Type: Bug Fix
Doc Text:
The `-h` and `--help` options were not recognized by +qpid-ha+, and were treated the same way as running +qpid-ha+ (without any argument). All returned the exit code `1` instead of `0`, which displayed `Exception: No valid command`. Fix: The `-h` and `-help` options are now implemented to return the result from `--help-all`, which displays command usage for +qpid-ha+ regardless of the commonly-passed method chosen by the user.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-08 13:09:07 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:
Attachments:
Description Flags
Current qpid-tools-0.22-14.el6 behavior none

Description Frantisek Reznicek 2014-09-02 06:43:06 UTC
Description of problem:

qpid-ha -h or --help should exit with returncode of 0.

At the moment switches qpid-ha -h and qpid-ha --help are treated the same way as giving qpid-ha (w/o any argument) and all three return exitcode 1.

qpid-ha --help / -h should behave as --help-all i.e. exit with exit code 0 and avoid message 'Exception: No valid command'.


Version-Release number of selected component (if applicable):
qpid-tools-0.22-14.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. qpid-ha -h;echo $?
   $? == 1 but should be 0
2. qpid-ha --help; ecode $?
   $? == 1 but should be 0
3. qpid-ha --help-all; ecode $?
   $? == 0 which is perfect
4. qpid-ha; ecode $?
   $? == 1 which is perfect

Actual results:
  qpid-ha -h / --help exit codes for failure.

Expected results:
  qpid-ha -h / --help exit codes for pass.

Additional info:

Comment 1 Frantisek Reznicek 2014-09-02 06:44:31 UTC
Created attachment 933608 [details]
Current qpid-tools-0.22-14.el6 behavior

Comment 2 Alan Conway 2014-12-01 21:11:14 UTC
Fixed.

------------------------------------------------------------------------
r1642758 | aconway | 2014-12-01 16:10:51 -0500 (Mon, 01 Dec 2014) | 2 lines

NO-JIRA: qpid-ha don't return error status if called with -h or --help flag.

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

Comment 4 Frantisek Reznicek 2015-07-16 11:08:49 UTC
The exit code issue has been fully fixed, tested on RHEL 6.7 / 7.1 on packages
qpid-tools-0.34-1.el6.noarch
qpid-tools-0.34-1.el7.noarch

-> VERIFIED

Comment 6 errata-xmlrpc 2015-10-08 13:09:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-1879.html