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("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("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("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("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("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("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("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("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("hostname=" + _ip);
    _bootOrRebootCommand.add("usrname=" + _username);
    _bootOrRebootCommand.add("password=" + _password, ParamType.PASSWORD);
View Full Code Here


      if (scriptPath == null) {
        throw new CloudRuntimeException("Unable to find key ipmi script "
            + injectScript);
      }

      final Script2 command = new Script2(scriptPath, s_logger);
      command.add("ping");
      command.add("hostname="+ipmiIp);
      command.add("usrname="+username);
      command.add("password="+password, ParamType.PASSWORD);
      final String result = command.execute();
      if (result != null) {
        s_logger.warn(String.format("Can not set up ipmi connection(ip=%1$s, username=%2$s, password=%3$s, args) because %4$s", ipmiIp, username, "******", result));
        return null;
      }
     
View Full Code Here

        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

            if (scriptPath == null) {
                throw new CloudRuntimeException("Unable to find key ipmi script "
                        + injectScript);
            }

            final Script2 command = new Script2(scriptPath, s_logger);
            command.add("ping");
            command.add("hostname="+ipmiIp);
            command.add("usrname="+username);
            command.add("password="+password, ParamType.PASSWORD);
            final String result = command.execute();
            if (result != null) {
                s_logger.warn(String.format("Can not set up ipmi connection(ip=%1$s, username=%2$s, password=%3$s, args) because %4$s", ipmiIp, username, "******", result));
                return null;
            }

View Full Code Here

    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

        String injectScript = "scripts/util/ipmi.py";
    String scriptPath = Script.findScript("", injectScript);
    if (scriptPath == null) {
       throw new ConfigurationException("Cannot find ping script " + scriptPath);
    }
    _pingCommand = new Script2(scriptPath, s_logger);
    _pingCommand.add("ping");
    _pingCommand.add("hostname="+_ip);
    _pingCommand.add("usrname="+_username);
    _pingCommand.add("password="+_password, ParamType.PASSWORD);
   
    _setPxeBootCommand = new Script2(scriptPath, s_logger);
    _setPxeBootCommand.add("boot_dev");
    _setPxeBootCommand.add("hostname="+_ip);
    _setPxeBootCommand.add("usrname="+_username);
    _setPxeBootCommand.add("password="+_password, ParamType.PASSWORD);
    _setPxeBootCommand.add("dev=pxe");
   
    _setDiskBootCommand = new Script2(scriptPath, s_logger);
    _setDiskBootCommand.add("boot_dev");
    _setDiskBootCommand.add("hostname="+_ip);
    _setDiskBootCommand.add("usrname="+_username);
    _setDiskBootCommand.add("password="+_password, ParamType.PASSWORD);
    _setDiskBootCommand.add("dev=disk");
   
    _rebootCommand = new Script2(scriptPath, s_logger);
    _rebootCommand.add("reboot");
    _rebootCommand.add("hostname="+_ip);
    _rebootCommand.add("usrname="+_username);
    _rebootCommand.add("password="+_password, ParamType.PASSWORD);
   
    _getStatusCommand = new Script2(scriptPath, s_logger);
    _getStatusCommand.add("ping");
    _getStatusCommand.add("hostname="+_ip);
    _getStatusCommand.add("usrname="+_username);
    _getStatusCommand.add("password="+_password, ParamType.PASSWORD);
   
    _powerOnCommand = new Script2(scriptPath, s_logger);
    _powerOnCommand.add("power");
    _powerOnCommand.add("hostname="+_ip);
    _powerOnCommand.add("usrname="+_username);
    _powerOnCommand.add("password="+_password, ParamType.PASSWORD);
    _powerOnCommand.add("action=on");
   
    _powerOffCommand = new Script2(scriptPath, s_logger);
    _powerOffCommand.add("power");
    _powerOffCommand.add("hostname="+_ip);
    _powerOffCommand.add("usrname="+_username);
    _powerOffCommand.add("password="+_password, ParamType.PASSWORD);
    _powerOffCommand.add("action=soft");
   
        _forcePowerOffCommand = new Script2(scriptPath, s_logger);
        _forcePowerOffCommand.add("power");
        _forcePowerOffCommand.add("hostname=" + _ip);
        _forcePowerOffCommand.add("usrname=" + _username);
        _forcePowerOffCommand.add("password=" + _password, ParamType.PASSWORD);
        _forcePowerOffCommand.add("action=off");

    _bootOrRebootCommand = new Script2(scriptPath, s_logger);
    _bootOrRebootCommand.add("boot_or_reboot");
    _bootOrRebootCommand.add("hostname="+_ip);
    _bootOrRebootCommand.add("usrname="+_username);
    _bootOrRebootCommand.add("password="+_password, ParamType.PASSWORD);
   
View Full Code Here

      if (scriptPath == null) {
        throw new CloudRuntimeException("Unable to find key ipmi script "
            + injectScript);
      }

      final Script2 command = new Script2(scriptPath, s_logger);
      command.add("ping");
      command.add("hostname="+ipmiIp);
      command.add("usrname="+username);
      command.add("password="+password, ParamType.PASSWORD);
      final String result = command.execute();
      if (result != null) {
        s_logger.warn(String.format("Can not set up ipmi connection(ip=%1$s, username=%2$s, password=%3$s, args) because %4$s", ipmiIp, username, "******", result));
        return null;
      }
     
View Full Code Here

    String injectScript = "scripts/util/ipmi.py";
    String scriptPath = Script.findScript("", injectScript);
    if (scriptPath == null) {
      throw new ConfigurationException("Cannot find ping script " + scriptPath);
    }
    _pingCommand = new Script2(scriptPath, s_logger);
    _pingCommand.add("ping");
    _pingCommand.add("hostname=" + _ip);
    _pingCommand.add("usrname=" + _username);
    _pingCommand.add("password=" + _password, ParamType.PASSWORD);

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

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

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

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

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

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

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

    _bootOrRebootCommand = new Script2(scriptPath, s_logger);
    _bootOrRebootCommand.add("boot_or_reboot");
    _bootOrRebootCommand.add("hostname=" + _ip);
    _bootOrRebootCommand.add("usrname=" + _username);
    _bootOrRebootCommand.add("password=" + _password, ParamType.PASSWORD);
View Full Code Here

      if (scriptPath == null) {
        throw new CloudRuntimeException("Unable to find key ipmi script "
            + injectScript);
      }

      final Script2 command = new Script2(scriptPath, s_logger);
      command.add("ping");
      command.add("hostname="+ipmiIp);
      command.add("usrname="+username);
      command.add("password="+password, ParamType.PASSWORD);
      final String result = command.execute();
      if (result != null) {
        s_logger.warn(String.format("Can not set up ipmi connection(ip=%1$s, username=%2$s, password=%3$s, args) because %4$s", ipmiIp, username, "******", result));
        return null;
      }
     
View Full Code Here

      if (scriptPath == null) {
        throw new CloudRuntimeException("Unable to find key ipmi script "
            + injectScript);
      }

      final Script2 command = new Script2(scriptPath, s_logger);
      command.add("ping");
      command.add("hostname="+ipmiIp);
      command.add("usrname="+username);
      command.add("password="+password, ParamType.PASSWORD);
      final String result = command.execute();
      if (result != null) {
        s_logger.warn(String.format("Can not set up ipmi connection(ip=%1$s, username=%2$s, password=%3$s, args) because %4$s", ipmiIp, username, "******", result));
        return null;
      }
     
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.