Bug 1013556 - [Quota]: The return value of `help' command should be 0
[Quota]: The return value of `help' command should be 0
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: glusterfs (Show other bugs)
2.1
x86_64 Linux
high Severity medium
: ---
: ---
Assigned To: Anuradha
Saurabh
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-30 06:37 EDT by Sachidananda Urs
Modified: 2016-09-19 22:00 EDT (History)
11 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0.35rhs
Doc Type: Bug Fix
Doc Text:
Previously, the help option with Quota did not display appropriate message. Executing a quota command with an invalid option would not have a clear output. Now, with this fix an error message is displayed indicating that the option is invalid while executing the the quota command.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-27 10:41:05 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachidananda Urs 2013-09-30 06:37:17 EDT
Description of problem:
The return value of the quota help command, upon successful printing of help text should be 0 not 1

[root@boggs ~]# gluster volume quota pure_gold help >/dev/null 2>&1                                      
[root@boggs ~]# echo $?
1

For example:
[root@boggs ~]# glusterfs --help >/dev/null 2>&1
[root@boggs ~]# echo $?
0

Version-Release number of selected component (if applicable):
glusterfs 3.4.0.33rhs

How reproducible:
Always.

Actual results:
return value of help command is 1

Expected results:
return value of help command should be 0

Additional info:
Standard Unix utilities return 0 as a convention.

[root@boggs ~]# ls --help >/dev/null 
[root@boggs ~]# echo $?
0
[root@boggs ~]# dd --help > /dev/null 
[root@boggs ~]# echo $?
0
[root@boggs ~]#
Comment 1 Sachidananda Urs 2013-09-30 06:41:07 EDT
If help is displayed as part of a syntax mistake, 1 is a valid return value. But not for `help' command in itself.

[root@boggs ~]# gluster volume quota pure_gold default-soft-limit 50 a                                    
Usage: volume quota <VOLNAME> {enable|disable|list [<path> ...]|remove <path>| default-soft-limit <percent>} |
volume quota <VOLNAME> {limit-usage <path> <size> [<percent>]} |
volume quota <VOLNAME> {alert-time|soft-timeout|hard-timeout} {<time>}
[root@boggs ~]# echo $?
1
Comment 3 Kaushal 2013-10-04 00:45:54 EDT
Quota does not actually have any 'help' subcommand. The usage message displayed is because of parse failure, because 'help' is not a known option. This is similar to what happens when you give unknown options to other commands as well.
For eg., in volume profile,
 # gluster volume profile test help
 Usage: volume profile <VOLNAME> {start|stop|info [nfs]}
 # echo $?
 1

Sac, do you still feel we need to correct this? If so then it must be done for all commands, not just quota.
Comment 4 Sachidananda Urs 2013-10-04 02:52:54 EDT
Doing it to all commands is useful. However, can't we print something like:

quota help: subcmd not found
Usage:

It is quite misleading.
Comment 8 Anuradha 2013-10-08 03:15:12 EDT
Patch posted for review on branch rhs-2.1 :
https://code.engineering.redhat.com/gerrit/#/c/13767/2

Patch posted for review on branch rhs-2.1-u1 :
https://code.engineering.redhat.com/gerrit/#/c/13771/
Comment 11 Pavithra 2013-10-29 06:48:24 EDT
hi Anuradha,

Can you please review the edited doc text for this bug? Once you sign off, this text will be added to the errata.
Comment 12 Anuradha 2013-10-30 03:07:10 EDT
Hi Pavithra,

The doc text has all the required info. It can be added to the errata.
Comment 14 errata-xmlrpc 2013-11-27 10:41:05 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-1769.html

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