Bug 965779 - Some sample CLI scripts for JON 3.1.1 contain errors.
Some sample CLI scripts for JON 3.1.1 contain errors.
Product: JBoss Operations Network
Classification: JBoss
Component: CLI (Show other bugs)
JON 3.1.1
Unspecified Unspecified
unspecified Severity high
: ER06
: JON 3.2.0
Assigned To: Lukas Krejci
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-05-21 13:21 EDT by taronson
Modified: 2014-01-02 15:39 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description taronson 2013-05-21 13:21:46 EDT
Description of problem: 1. Sample script file deploy-to-and-restart-JBASjs has error for specifying AS7 related plugin and name as in code snippet below. The plugin and name were incorrect for AS7. The code should be changed in all locations in the script to the code below.
else if (targetResourceType.plugin == "JBossAS7" &&
            (targetResourceType.name == "JBossAS7 Standalone Server" ||
                    targetResourceType.name == "JBossAS-Managed")) {
        return deployFn(_restartAS7);

Version-Release number of selected component (if applicable): JON 3.1.1 sample code for CLI plugin.

How reproducible: Run script with EAP 6 / AS7 servers configured and installed, group with the servers as inventory. Exception results in code as shown below:

throw "The resource group the destination targets doesn't seem to be a JBoss AS server group.";

2. Another bug in same script in #1 is call to deployBundle function in bundles.js. Function called from script deployt-to-and-restart-JBAS.js with three parameters, function takes 5.
Example call: var deployment = deployBundle(bundleVersion, destination, deploymentConfiguration, destinationName, false);

In bundles.js function signature is: function deployBundle(bundleVersion, destination, deploymentConfiguration, description, isCleanDeployment) {...

3. Also error in first two parameters in runction below in bundles.js or in calling js file specified in #1, #2 above. The two parameters are reversed so must be changed in calling script or function. This leads to IllegalArgument exception that is difficult to debug. 

var deployment = BundleManager.createBundleDeployment(bundleVersionId, destinationId, description, deploymentConfig);

Steps to Reproduce: (For bug #1 description is in below steps. Bugs #2 and #3 are easier changes but harder to debug.)
1. Create zip file with recipe file (deploy.xml) and at least one deployable archive.
2. Follow instructions for example starting in Section 4 example, p. 92; JBoss Operations Network 3.1 Writing JBoss ON Command-Line Scripts.

Actual results: Exception above results. Check other sections in this script also where plugin, name for AS7 servers are specified.

Expected results: Exception should not be thrown and bundle should be created and deployed.

Additional info:  This may be considered 3 bugs but did not submit 3 bug reports. These may have been changed in the code released with downloadable CLI plugin in JON 3.1.2.
Comment 1 Heiko W. Rupp 2013-08-28 07:39:20 EDT
Lukas can you please check this?
Comment 2 Lukas Krejci 2013-11-15 07:18:09 EST
All the points above seem to have been addressed in the 3.2.0 branch.

However, I discovered a typo in the samples/modules/jbossas.js sample JS module. This has been captured upstream by BZ 1030958.
Comment 3 Filip Brychta 2013-11-21 11:09:18 EST
Verified on
Version :	
Build Number :	

Covered by automation

Note You need to log in before you can comment on or make changes to this bug.