Bug 764019 (GLUSTER-2287)

Summary: Gluster CLI returns wrong return code.
Product: [Community] GlusterFS Reporter: Piotr Kandziora <raveenpl>
Component: cliAssignee: Pranith Kumar K <pkarampu>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 3.1.1CC: gluster-bugs, rabhat, raveenpl, vijay
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTP Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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#