Bug 1289316

Summary: [GSS](6.4.z) CLI does not resolve multiple properties if one property is undefined
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Aaron Ogburn <aogburn>
Component: CLIAssignee: Chao Wang <chaowan>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.5CC: bmaxwell, brian.stansberry, cdewolf, chaowan, ihradek, jboss-set, jtruhlar, ppalaga
Target Milestone: CR1   
Target Release: EAP 6.4.12   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: eap6412-proposed
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 13:10:50 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:
Bug Depends On: 1237275    
Bug Blocks: 1375585    

Description Aaron Ogburn 2015-12-07 20:50:54 UTC
Multiple property substitution is working with EAP 6.4.3+, however, if a variable amongst the multiple variables is empty or has no value, then the subsequent property in the CLI command is not substituted. 

For example : 
cat props.properties 
-----------------------------------------
PROFILE-NAME=TestProfile
SERVER-INSTANCE-NUMBER=TestInstance
APP-VERSION=
VAR=test
-----------------------------------------

cat test.cli :
---------------------------------------
/host=master/server-config=${PROFILE-NAME}${APP-VERSION}${SERVER-INSTANCE-NUMBER}${VAR}:add(auto-start=true, group="${PROFILE-NAME}${APP-VERSION}-server-group")
---------------------------------------

and if I execute "./jboss-cli.sh --connect --file=test.cli --properties=props.properties" then I have the following in the host.xml ": 

----------
...
<server name="TestProfile${SERVER-INSTANCE-NUMBER}test" group="TestProfile-server-group" auto-start="true"/>
...
-----------

Note APP-VERSION had no value, and so the subsequent SERVER-INSTANCE-NUMBER was not properly resolved

Comment 2 Chao Wang 2015-12-09 09:43:45 UTC
I have created upstream WFCORE-1198 to throw an UnresolvedExpressionException with informative message in such case, just to avoid to write unresolved value into configuration file in such case.

Comment 4 Mike McCune 2016-03-28 22:24:40 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Ivo Hradek 2016-11-22 08:59:48 UTC
Verified with EAP 6.4.12.CP.CR1;
--
Note: In order to get it work as expected, "resolve-parameter-values" in jboss-cli.xml must be set to true.

Comment 7 Petr Penicka 2017-01-17 13:10:50 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.