Bug 965779 - Some sample CLI scripts for JON 3.1.1 contain errors.
Summary: Some sample CLI scripts for JON 3.1.1 contain errors.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI
Version: JON 3.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER06
: JON 3.2.0
Assignee: Lukas Krejci
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-21 17:21 UTC by taronson
Modified: 2014-01-02 20:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description taronson 2013-05-21 17:21:46 UTC
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.
3.

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 11:39:20 UTC
Lukas can you please check this?

Comment 2 Lukas Krejci 2013-11-15 12:18:09 UTC
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 16:09:18 UTC
Verified on
Version :	
3.2.0.ER5
Build Number :	
2cb2bc9:225c796

Covered by automation


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