Bug 621545 - Provide an API for a script to invoke other scripts in non-interactive mode
Provide an API for a script to invoke other scripts in non-interactive mode
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
3.0.0
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-05 09:08 EDT by John Sanda
Modified: 2014-06-18 15:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-18 15:48:51 EDT
Type: ---
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 John Sanda 2010-08-05 09:08:59 EDT
Description of problem:
At the interactive you can execute a script with the built-in exec command as follows,

$ exec -f path/to/my/script.js

The exec command is built into the CLI and only available in interactive mode. Providing a means for a script to invoke other scripts would provide a much more robust scripting environment. Consider this. We have a number of common utility functions and/or objects that we put into common_util.js. When we execute some other script, we'd like to have access the functions/objects in common_util.js.

Adding this capability is really straightforward. We have already made the built-in login and logout commands available through the class Controller. An instance of Controller is bound under the name 'rhq' in every script context. We could expose a new method in Controller that takes a single string argument which should be the path to the script.

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


How reproducible:


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


Expected results:


Additional info:
Comment 1 Jay Shaughnessy 2014-06-18 15:48:51 EDT
You can use modules for this.

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