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
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
PATCH: http://patches.gluster.com/patch/5980 in master (cli: return error when cmd execution fails)
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#