Examples of AllLinesParser


Examples of com.cloud.utils.script.OutputInterpreter.AllLinesParser

    protected void destroyVMs(String mountPath) {
        /* if there are VMs using disks under this mount path, destroy them */
        Script cmd = new Script("/bin/bash", _timeout);
        cmd.add("-c");
        cmd.add("ps axu|grep qemu|grep " + mountPath + "* |awk '{print $2}'");
        AllLinesParser parser = new OutputInterpreter.AllLinesParser();
        String result = cmd.execute(parser);

        if (result != null) {
            return;
        }

        String pids[] = parser.getLines().split("\n");
        for (String pid : pids) {
            Script.runSimpleBashScript("kill -9 " + pid);
        }
    }
View Full Code Here

Examples of com.cloud.utils.script.OutputInterpreter.AllLinesParser

    protected void destroyVMs(String mountPath) {
        /* if there are VMs using disks under this mount path, destroy them */
        Script cmd = new Script("/bin/bash", _timeout);
        cmd.add("-c");
        cmd.add("ps axu|grep qemu|grep " + mountPath + "* |awk '{print $2}'");
        AllLinesParser parser = new OutputInterpreter.AllLinesParser();
        String result = cmd.execute(parser);

        if (result != null) {
            return;
        }

        String pids[] = parser.getLines().split("\n");
        for (String pid : pids) {
            Script.runSimpleBashScript("kill -9 " + pid);
        }
    }
View Full Code Here

Examples of com.cloud.utils.script.OutputInterpreter.AllLinesParser

    }

    @Override
    public ExecutionResult executeInVR(String routerIp, String script, String args, int timeout) {
        final Script command = new Script(_routerProxyPath, timeout * 1000, s_logger);
        final AllLinesParser parser = new AllLinesParser();
        command.add(script);
        command.add(routerIp);
        if (args != null) {
            command.add(args);
        }
        String details = command.execute(parser);
        if (details == null) {
            details = parser.getLines();
        }
        return new ExecutionResult(command.getExitValue() == 0, details);
    }
View Full Code Here

Examples of com.cloud.utils.script.OutputInterpreter.AllLinesParser

    protected void destroyVMs(String mountPath) {
        /* if there are VMs using disks under this mount path, destroy them */
        Script cmd = new Script("/bin/bash", _timeout);
        cmd.add("-c");
        cmd.add("ps axu|grep qemu|grep " + mountPath + "* |awk '{print $2}'");
        AllLinesParser parser = new OutputInterpreter.AllLinesParser();
        String result = cmd.execute(parser);

        if (result != null) {
            return;
        }

        String pids[] = parser.getLines().split("\n");
        for (String pid : pids) {
            Script.runSimpleBashScript("kill -9 " + pid);
        }
    }
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.