Package com.cloud.utils.script

Examples of com.cloud.utils.script.Script2


    String scriptPath = Script.findScript("", injectScript);
    if (scriptPath == null) {
      throw new ConfigurationException("Cannot find ping script " + scriptPath);
    }
    String pythonPath = "/usr/bin/python";
    _pingCommand = new Script2(pythonPath, s_logger);
    _pingCommand.add(scriptPath);
    _pingCommand.add("ping");
        _pingCommand.add("interface=" + ipmiIface);
    _pingCommand.add("hostname=" + _ip);
    _pingCommand.add("usrname=" + _username);
    _pingCommand.add("password=" + _password, ParamType.PASSWORD);

    _setPxeBootCommand = new Script2(pythonPath, s_logger);
    _setPxeBootCommand.add(scriptPath);
    _setPxeBootCommand.add("boot_dev");
        _setPxeBootCommand.add("interface=" + ipmiIface);
    _setPxeBootCommand.add("hostname=" + _ip);
    _setPxeBootCommand.add("usrname=" + _username);
    _setPxeBootCommand.add("password=" + _password, ParamType.PASSWORD);
    _setPxeBootCommand.add("dev=pxe");

    _setDiskBootCommand = new Script2(pythonPath, s_logger);
    _setDiskBootCommand.add(scriptPath);
    _setDiskBootCommand.add("boot_dev");
        _setDiskBootCommand.add("interface=" + ipmiIface);
    _setDiskBootCommand.add("hostname=" + _ip);
    _setDiskBootCommand.add("usrname=" + _username);
    _setDiskBootCommand.add("password=" + _password, ParamType.PASSWORD);
    _setDiskBootCommand.add("dev=disk");

    _rebootCommand = new Script2(pythonPath, s_logger);
    _rebootCommand.add(scriptPath);
    _rebootCommand.add("reboot");
        _rebootCommand.add("interface=" + ipmiIface);
    _rebootCommand.add("hostname=" + _ip);
    _rebootCommand.add("usrname=" + _username);
    _rebootCommand.add("password=" + _password, ParamType.PASSWORD);

    _getStatusCommand = new Script2(pythonPath, s_logger);
    _getStatusCommand.add(scriptPath);
    _getStatusCommand.add("ping");
        _getStatusCommand.add("interface=" + ipmiIface);
    _getStatusCommand.add("hostname=" + _ip);
    _getStatusCommand.add("usrname=" + _username);
    _getStatusCommand.add("password=" + _password, ParamType.PASSWORD);

    _powerOnCommand = new Script2(pythonPath, s_logger);
    _powerOnCommand.add(scriptPath);
    _powerOnCommand.add("power");
        _powerOnCommand.add("interface=" + ipmiIface);
    _powerOnCommand.add("hostname=" + _ip);
    _powerOnCommand.add("usrname=" + _username);
    _powerOnCommand.add("password=" + _password, ParamType.PASSWORD);
    _powerOnCommand.add("action=on");

    _powerOffCommand = new Script2(pythonPath, s_logger);
    _powerOffCommand.add(scriptPath);
    _powerOffCommand.add("power");
        _powerOffCommand.add("interface=" + ipmiIface);
    _powerOffCommand.add("hostname=" + _ip);
    _powerOffCommand.add("usrname=" + _username);
    _powerOffCommand.add("password=" + _password, ParamType.PASSWORD);
    _powerOffCommand.add("action=soft");

    _forcePowerOffCommand = new Script2(pythonPath, s_logger);
    _forcePowerOffCommand.add(scriptPath);
    _forcePowerOffCommand.add("power");
        _forcePowerOffCommand.add("interface=" + ipmiIface);
    _forcePowerOffCommand.add("hostname=" + _ip);
    _forcePowerOffCommand.add("usrname=" + _username);
    _forcePowerOffCommand.add("password=" + _password, ParamType.PASSWORD);
    _forcePowerOffCommand.add("action=off");

    _bootOrRebootCommand = new Script2(pythonPath, s_logger);
    _bootOrRebootCommand.add(scriptPath);
    _bootOrRebootCommand.add("boot_or_reboot");
        _bootOrRebootCommand.add("interface=" + ipmiIface);
    _bootOrRebootCommand.add("hostname=" + _ip);
    _bootOrRebootCommand.add("usrname=" + _username);
View Full Code Here

TOP

Related Classes of com.cloud.utils.script.Script2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.