Package com.cloud.utils.script

Examples of com.cloud.utils.script.Script.execute()


            command.add("-P ", rule.getProtocol().toLowerCase());
            command.add("-l ", rule.getSrcIp());
            command.add("-p ", rule.getStringSrcPortRange());
            command.add("-r ", rule.getDstIp());
            command.add("-d ", rule.getStringDstPortRange());
            result = command.execute();
            if (result == null) {
                results[i++] = null;
            } else {
                results[i++] = "Failed";
                endResult = false;
View Full Code Here


        final Script command = new Script(_modifyVlanPath, _timeout, s_logger);
        command.add("-v", vnetId);
        command.add("-p", pif);
        command.add("-o", "add");

        final String result = command.execute();
        if (result != null) {
            throw new InternalErrorException("Failed to create vnet " + vnetId
                    + ": " + result);
        }
    }
View Full Code Here

    private void deletExitingLinkLocalRoutTable(String linkLocalBr) {
        Script command = new Script("/bin/bash", _timeout);
        command.add("-c");
        command.add("ip route | grep " + NetUtils.getLinkLocalCIDR());
        OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();
        String result = command.execute(parser);
        boolean foundLinkLocalBr = false;
        if (result == null && parser.getLines() != null) {
            String[] lines = parser.getLines().split("\\n");
            for (String line : lines) {
                String[] tokens = line.split(" ");
View Full Code Here

    private boolean isBridgeExists(String bridgeName) {
        Script command = new Script("/bin/sh", _timeout);
        command.add("-c");
        command.add("brctl show|grep " + bridgeName);
        final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
        String result = command.execute(parser);
        if (result != null || parser.getLine() == null) {
            return false;
        } else {
            return true;
        }
View Full Code Here

            }
           
            command.add(" -d ", rule.getStringSrcPortRange());
            command.add(" -G ") ;
           
            result = command.execute();
            if (result == null) {
                results[i++] = null;
            } else {
                results[i++] = "Failed";
                endResult = false;
View Full Code Here

            if (tmpFile != null) {
                command.add("-d", tmpFile.getAbsolutePath());
            }

            final String result = command.execute();

            if (tmpFile != null) {
                boolean deleted = tmpFile.delete();
                if (!deleted) {
                    s_logger.warn("Failed to clean up temp file after sending vmdata");
View Full Code Here

                sb.append(statsRules[i]).append(',');
            }
            command.add("-s", sb.toString());
        }
       
        return command.execute();
    }

    protected synchronized Answer execute(final SavePasswordCommand cmd) {
        final String password = cmd.getPassword();
        final String routerPrivateIPAddress = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
View Full Code Here

       
        if (cmd.getDefaultDns() != null) {
          command.add("-N", cmd.getDefaultDns());
        }

        final String result = command.execute();
        return new Answer(cmd, result==null, result);
    }

    public String getRouterStatus(String routerIP) {
        return routerProxyWithParser("checkrouter.sh", routerIP, null);
View Full Code Here

        command.add(script);
        command.add(routerIP);
        if ( args != null ) {
            command.add(args);
        }
        String result = command.execute(parser);
        if (result == null) {
            return parser.getLine();
        }
        return null;
    }
View Full Code Here

        command.add(script);
        command.add(routerIP);
        if ( args != null ) {
            command.add(args);
        }
        return command.execute();
    }

    protected Answer execute(CheckRouterCommand cmd) {
        final String routerPrivateIPAddress = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.