Bug 1136191 - qpid-ha -h or --help should exit with returncode of 0
Summary: qpid-ha -h or --help should exit with returncode of 0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-tools
Version: Development
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: 3.2
: ---
Assignee: Alan Conway
QA Contact: Frantisek Reznicek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-02 06:43 UTC by Frantisek Reznicek
Modified: 2015-11-16 01:17 UTC (History)
4 users (show)

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.
Clone Of:
Environment:
Last Closed: 2015-10-08 13:09:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Current qpid-tools-0.22-14.el6 behavior (8.75 KB, text/plain)
2014-09-02 06:44 UTC, Frantisek Reznicek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:1879 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.2 Release 2015-10-08 17:07:53 UTC

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


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