Bug 757958 - Fix errors in drift.js sample CLI script
Fix errors in drift.js sample CLI script
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: CLI (Show other bugs)
JON 3.0.0
Unspecified Unspecified
medium Severity medium
: ER05
: JON 3.2.0
Assigned To: John Sanda
Mike Foley
:
Depends On: jon30-sprint9
Blocks: 707225
  Show dependency treegraph
 
Reported: 2011-11-28 23:19 EST by John Sanda
Modified: 2014-01-02 15:34 EST (History)
4 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description John Sanda 2011-11-28 23:19:16 EST
Description of problem:
The drift.js script that is packaged in the samples directory of the CLI distro uses classes and methods that have gone through several iterations of renaming after the script was initially written. There are several errors in the script consequently. The script needs to be updated to use the current drift APIs.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 John Sanda 2011-11-29 11:08:57 EST
The script has been updated along with documented usage.

master commit hash:         cc717fc0ac9b891306738842910b026d3a485085
release_jon3.x commit hash: 6347cab2a33758186d8751d78633cfb9965b2f85
Comment 2 Mike Foley 2011-11-29 11:45:20 EST
sample script ... no impact on runtime.  lowering the priority.
Comment 3 Mike Foley 2011-12-19 15:04:09 EST
tested as follows:

used the inline usage example in drift.js 


 * usage:
 *   // generates a snapshot that includes all change sets belonging to the
 *   // mydrift drift configuration.
 *   createSnapshot(123, 'mydrift') 
 *


----------

actual results ...


rhqadmin@localhost:7080$ exec -f util.js 

rhqadmin@localhost:7080$ exec -f drift.js

rhqadmin@localhost:7080$ createSnapshot(123, 'mydrift1') 
Wrapped java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 (<Unknown source>#71)
createSnapshot(123, 'mydrift1') 
^

rhqadmin@localhost:7080$ createSnapshot(123, 'drift1')  
Wrapped java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 (<Unknown source>#71)
createSnapshot(123, 'drift1') 
^



jsanda ... advice?  is this the expected behavior?
Comment 4 John Sanda 2011-12-20 14:41:42 EST
Mike, the example in the source docs is just that. Do you have a drift definition named mydrift1? If not then the errors may in fact be expected.
Comment 5 Larry O'Leary 2012-11-27 19:10:44 EST
Setting back to ON_QA and re-targeting for JBoss ON 3.2 release for verification.
Comment 6 Larry O'Leary 2013-09-06 10:31:14 EDT
As this is MODIFIED or ON_QA, setting milestone to ER1.
Comment 7 Simeon Pinder 2013-09-20 09:30:13 EDT
I think this was moved to ON_QA in error. My apologies. Moving back to ASSIGNED state and into ER02.
Comment 8 Simeon Pinder 2013-09-30 09:37:04 EDT
Moving into ER3 as didn't make it into ER2.
Comment 9 Simeon Pinder 2013-10-08 03:52:55 EDT
Moving into ER04 as not completed in ER03.
Comment 10 Simeon Pinder 2013-10-24 00:16:32 EDT
Moving to ER05 as missed the cutoff for ER04.
Comment 11 John Sanda 2013-10-25 12:58:44 EDT
I have gone ahead and made some minor updates in the examples listed in the source code docs. The problem in comment 3 is due to the fact that the function was called using the example verbatim. Since the function takes as input a resource id and a drift definition name, I think (and hope) it is fairly obvious that the function arguments in the example are just that - examples and not actual values.

release/jon3.2.x commit hash: 05715a631
Comment 12 Simeon Pinder 2013-11-06 21:18:13 EST
Moving to ON_QA for test with new brew build.
Comment 13 Filip Brychta 2013-12-09 07:13:28 EST
Covered by automation and passing .. http://jenkins.jonqe.lab.eng.bos.redhat.com:9080/view/Core%20tests/job/rhq-core-cli-js-test/276/HTML_Report/?

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