Bug 1033119 - Incorrect bundle destination is chosen in deploy-to-and-restart-JBAS.js sample file
Incorrect bundle destination is chosen in deploy-to-and-restart-JBAS.js samp...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: CLI (Show other bugs)
JON 3.2
Unspecified Unspecified
unspecified Severity medium
: CR01
: JON 3.2.0
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-21 10:19 EST by Filip Brychta
Modified: 2014-01-02 15:34 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-02 15:34:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Filip Brychta 2013-11-21 10:19:08 EST
Description of problem:
Here is the problem:
<code>
    var destinationId = jbasDestination;
    if (typeof(jbasDestination) == 'object') {
        destinationId = jbasDestination.id;
    }

    var destCrit = new BundleDestinationCriteria
    destCrit.fetchGroup(true)

    var destinations = BundleManager.findBundleDestinationsByCriteria(destCrit);
</code>

Used destCrit doesn't have FilterId set. So the findBundleDestinationsByCriteria function then finds first destination which could be incorrect.

Correct version:
<code>
    var destinationId = jbasDestination;
    if (typeof(jbasDestination) == 'object') {
        destinationId = jbasDestination.id;
    }

    var destCrit = new BundleDestinationCriteria
    destCrit.fetchGroup(true)
    destCrit.addFilterId(destinationId);

    var destinations = BundleManager.findBundleDestinationsByCriteria(destCrit);
</code>

Version-Release number of selected component (if applicable):
Jon3.2.ER5 and master as well:
Version :	
4.10.0-SNAPSHOT
Build Number :	
cb5f098
Comment 1 Filip Brychta 2013-11-21 10:46:39 EST
The same problem is in jbossas module
Comment 2 Lukas Krejci 2013-11-21 15:49:40 EST
Note that this was fixed POST ER7.

commit 3217afa463913656a1e0af3b58b27a782f55d472
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Thu Nov 21 21:41:06 2013 +0100

    [BZ 1033119] Find the asked for destination, not just a random one in
    deploy-to-and-restrart-JBAS.js#updateAppAndRestartJBAS(),
    require("modules:/jbossas").updateAppAndRestart()
Comment 3 Simeon Pinder 2013-12-03 18:19:37 EST
Moving to ON_QA for testing in latest(CR1) brew build.
Comment 4 Filip Brychta 2013-12-04 03:55:27 EST
Verified on:
Version :	
3.2.0.CR1
Build Number :	
6ecd678:d0dc0b6

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