Bug 784953
| Summary: | JON 3.01 RC#1 CLI samples ... usability issue with drift.js | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Operations Network | Reporter: | Mike Foley <mfoley> |
| Component: | CLI | Assignee: | RHQ Project Maintainer <rhq-maint> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | JON 3.0.1 | CC: | hrupp, lkrejci, loleary |
| Target Milestone: | ER01 | ||
| Target Release: | JON 3.2.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Task | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 852145 | ||
| Bug Blocks: | |||
|
Description
Mike Foley
2012-01-26 18:57:57 UTC
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos The proper solution is to implement the import mechanism that the scripts could use. I.e. something akin to http://requirejs.org (note that this is not that simple, because ideally, the mechanism should work both in the CLI proper and in the serverside CLI alert scripts - but requirejs has a pluggable script loader mechanism, so maybe we would be able to hook it up on the serverside with the scripts stored in RHQ repos). A workaround might be to add ability to load multiple script files using the -f commandline option. This however would not be so user friendly anyway, because the user would need to know the requirements of the scripts upfront and specify them in the -f option in a specific order. Given Lukas' comment this is not going to be resolvable in 3.0.1. Resetting for *consideration* as part JON3.1.0. Discussion of our options for implementing the script modularity: http://rhq-project.org/display/RHQ/Script+Modularity This is an action/enhancement requested by QE to make testing easier. The support for modular/includes in the CLI appears to have been implemented in upstream bug 852145. Resetting for triage in 3.2.0. Hopefully something useful will happen once we realize that this is already available upstream and just needs to be brought into the product. In RHQ 4.6 codebase (or maybe already in RHQ 4.5.1 actually), the following has been done:
1) The scripts in the "samples" directory in the CLI distribution were left intact.
2) A new subdirectory called "modules" was added under "samples", which contains the "modularized" versions of the scripts in samples.
3) The modularized version of drift.js can be loaded in the CLI by issuing the following command:
var drift = require("modules:/drift")
4) The functions from the drift.js file are then available through the "drift" variable in the example above.
Note that the the location from where the "modules:/..." scripts are loaded is configurable and defaults to $CLI_HOME/samples/modules. It can be changed by passing a different path using "rhq.scripting.modules.root-dir" system property.
I.e. starting the CLI like:
RHQ_CLI_ADDITIONAL_JAVA_OPTS="-Drhq.scripting.modules.root-dir=<ABS_PATH>" $CLI_HOME/bin/rhq-cli.sh
will set the base path from where the modules are loaded (using the "modules:/" path prefix) to the <ABS_PATH>
(no code change here, so setting the status to ON_QA straight away)
As this is MODIFIED or ON_QA, setting milestone to ER1. verified
unconnected$ var drift = require("modules:/drift")
unconnected$ drift.
createSnapshot diff fetchHistory
unconnected$ drift.
|