Description of problem: ======================= CLI is not substituting the second property in the elements name for example in the following CLI command: -------- /profile=${PROFILENAME}${APPVERSION}:add() -------- Even after setting "<resolve-parameter-values>" property to true, the behaviour is not as expected. The above command is setting the following value in domain.xml: -------- <profile name="profile1${APPVERSION}"/> -------- Here it means only the first property substitution is done, but the second property is not being replaced by its value. Version-Release number of selected component (if applicable): ============================================================= EAP 6.4.0 and EAP 6.4.1 as well as I have tested this behaviour in both the version. How reproducible: ================= Following are the steps to reproduce. Steps to Reproduce: =================== 1) Created a properties file "my.properties" like this: -------------- PROFILENAME=profile1 APPVERSION=-ver1 -------------- 2) Created a .cli file "AddProfile.cli" like this: --------------- if (outcome != success) of /profile=${PROFILENAME}${APPVERSION}:read-resource /profile=${PROFILENAME}${APPVERSION}:add() end-if --------------- 3) Set the value of "<resolve-parameter-values>" property to "true" in the jboss-cli.xml. 4) Then executed the following command: --------------- ./jboss-cli.sh -c --file=AddProfile.cli --properties=my.properties --------------- The above CLI command adds the following configuration in the domain.xml: --------------- <profile name="profile1${APPVERSION}"/> --------------- Actual results: =============== CLI command "/profile=${PROFILENAME}${APPVERSION}:add()" is setting the following value in domain.xml: -------- <profile name="profile1${APPVERSION}"/> -------- Expected results: ================= CLI command "/profile=${PROFILENAME}${APPVERSION}:add()" should set the following value in domain.xml: -------- <profile name="profile1-ver1"/> -------- Additional info: ================ This behaviour is same in the EAP 6.4.1 as well. Workaround: =========== Following shell script can be used as a workaround for achieving above kind of property isolation in CLI commands. testcli.sh: ----------- #!/bin/sh . /PATH-UP-TILL/my.properties $JBOSS_HOME/bin/jboss-cli.sh --connect <<EOF if (outcome != success) of /profile=${PROFILENAME}${APPVERSION}:read-resource /profile=${PROFILENAME}${APPVERSION}:add() end-if exit EOF ----------- The above shell script uses the property file and substitutes the property's values as expected. for example in this case: ----------- <profile name="profile1-ver1"/> -----------
PR: https://github.com/jbossas/jboss-eap/pull/2477
Thank you for the tests in PR.
Verified on EAP 6.4.3.CP.CR1
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.