Bug 1149648

Summary: Enhanced usage of system properties in jboss-cli
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Tomas Rohovsky <trohovsk>
Component: CLIAssignee: Alexey Loubyansky <olubyans>
Status: CLOSED WONTFIX QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: brian.stansberry, nziakova, oskutka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-01 12:28:47 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas Rohovsky 2014-10-06 10:55:04 UTC
This enhancement report contains multiple issues regarding usage of system properties in CLI scripts [1]

1. Setting of system properties directly as jboss-cli arguments
It would be nice to set system properties like:

./jboss-cli.sh -Dvar=true -file=ds.cli

Currently is supported only loading of properties from URL by --properteis option. A customer is asking for this behaviour [2]. A workaround exists for that:

JAVA_OPTS="-Dvar=true" bin/jboss-cli.sh --connect --file=ds.cli

ds.cli:
/subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=${var})

2. Property placeholders cannot be anywhere
The article [1] states that placeholders can be only in operation parameter values and command arguments [1]. The second seems to not be true. I tried following without success:

JAVA_OPTS="-Dvar=deployment" bin/jboss-cli.sh --connect --file=ls.cli

ls.cli:
ls ${var}

I think that it should be provided to filter the CLI script file as a resource, regardless where the placeholders are.

Following is not working now:

JAVA_OPTS="-Dds=ExampleDS" bin/jboss-cli.sh --connect --file=ds.cli

ds.cli:
/subsystem=datasources/data-source=${ds}/statistics=pool:read-resource(include-runtime=true)

3. --properties option is not in the helptext (./jboss-cli.sh --help)

4. Configuring of resolve-parameter-values seems to be useless
If --properties option is present (or -D options would be present) then jboss-cli could behave like resolve-parameter-values would be activated.


[1] https://developer.jboss.org/wiki/SystemPropertiesInOperationParameterValuesAndCommandArguments
[2] https://c.na7.visual.force.com/apex/Case_View?id=500A000000N0zxDIAR&sfdc.override=1

Comment 1 Tomas Rohovsky 2014-10-06 10:57:02 UTC
Let me know if you would like to see the issues in separate BZs.

Comment 2 Nikoleta Hlavickova 2014-10-06 11:13:18 UTC
Arguments passing using -D does not work as reported in BZ 1103620