Bug 764019 (GLUSTER-2287) - Gluster CLI returns wrong return code.
Summary: Gluster CLI returns wrong return code.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-2287
Product: GlusterFS
Classification: Community
Component: cli
Version: 3.1.1
Hardware: All
OS: Windows
low
low
Target Milestone: ---
Assignee: Pranith Kumar K
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-10 22:57 UTC by Piotr Kandziora
Modified: 2011-05-04 08:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTP
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Piotr Kandziora 2011-01-10 20:02:22 UTC
Correct script output in first case (I have replaced manually volume name):

root@adam-dev:~# gluster volume info notexistent
Volume notexistent not present
root@adam-dev:~# echo $?
0

Comment 1 Piotr Kandziora 2011-01-10 22:57:17 UTC
Gluster CLI command returns wrong return code in case of giving not existent volume as a parameter for 'gluster volume info'. Example below:

root@adam-dev:~# gluster volume info notexistent
Volume sdfdsfds not present
root@adam-dev:~# echo $?
0


Correct return code should be 255 (as in exemplary output):

root@adam-dev:~# gluster volume reset notextistent
reset volume unsuccessful
Error while resetting options
root@adam-dev:~# echo $?
255

Comment 2 Anand Avati 2011-01-27 04:42:11 UTC
PATCH: http://patches.gluster.com/patch/5980 in master (cli: return error when cmd execution fails)

Comment 3 Raghavendra Bhat 2011-02-18 03:05:09 UTC
Now gluster volume info on a non existing volume gives nonzero return value.



root@bigbang:/home/raghu# gluster volume info iii
Volume iii does not exist
root@bigbang:/home/raghu# echo $?
255
root@bigbang:/home/raghu#


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