Bug 1033520

Summary: CLI returns exit code 0 even when an error occurs
Product: [Other] RHQ Project Reporter: Thomas Segismont <tsegismo>
Component: CLIAssignee: Thomas Segismont <tsegismo>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.9CC: asantos, hrupp
Target Milestone: ---   
Target Release: RHQ 4.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-23 12:29:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Thomas Segismont 2013-11-22 10:02:51 UTC
Description of problem:
CLI returns exit code 0 even when an error occurs

Version-Release number of selected component (if applicable):
4.9 and before

How reproducible:
Always

Steps to Reproduce:
1.Execute this CLI script
===
throw "Error"
===

Actual results:
The CLI outputs a JavascriptException and return code is 0

Expected results:
The CLI outputs a JavascriptException and return code is different than 0

Additional info:
We also need to check the exit code value when:
* the user provides wrong server connection credentials
* the user provides a nonexistent or unreadable file

Comment 1 Thomas Segismont 2013-11-26 11:10:28 UTC
Fixed in master

commit 204ff60c26d8a5cb48599d10b7c8b209f6e9b0c8
Author: Thomas Segismont <tsegismo>
Date:   Tue Nov 26 12:09:18 2013 +0100
    
In non interactive mode, exit code is 1 if :
* an error occurs while executing a command or a script
* login failed
* script file does not exist

Comment 2 Heiko W. Rupp 2014-04-23 12:29:55 UTC
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.