Package lcmc.cluster.service.ssh

Examples of lcmc.cluster.service.ssh.SshOutput


            cmd = "CRM.2.1.4.standByOn";
        }
        final Map<String, String> replaceHash = new HashMap<String, String>();
        replaceHash.put("@HOST@", standByHost.getName());
        final String command = host.getDistCommand(cmd, replaceHash);
        final SshOutput ret = execCommand(host, command, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here


        if (Tools.versionBeforePacemaker(host)) {
            cmd = "CRM.2.1.4.standByOff";
        }
        replaceHash.put("@HOST@", standByHost.getName());
        final String command = host.getDistCommand(cmd, replaceHash);
        final SshOutput ret = execCommand(host, command, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

    }

    public static boolean erase(final Host host, final Application.RunMode runMode) {
        final Map<String, String> replaceHash = Collections.emptyMap();
        final String command = host.getDistCommand("CRM.erase", replaceHash);
        final SshOutput ret = execCommand(host, command, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

    public static String crmConfigureCommit(final Host host, final String config, final Application.RunMode runMode) {
        final Map<String, String> replaceHash = new HashMap<String, String>();
        replaceHash.put("@CONFIG@", Tools.escapeQuotes(Matcher.quoteReplacement(config), 1));
        final String command = host.getDistCommand("CRM.configureCommit", replaceHash);
        final SshOutput ret = execCommand(host, command, runMode);
        if (ret.getExitCode() == 0) {
            return ret.getOutput();
        }
        return "error";
    }
View Full Code Here

                if ("/".equals(dir.toString())) {
                    dirSB.append('*');
                } else {
                    dirSB.append("/*");
                }
                final SshOutput out = host.captureCommandProgressIndicator(
                        "executing...",
                        new ExecCommandConfig().command("stat -c \"%A %a %Y %s %n\" " + dirSB + " 2>/dev/null")
                                .silentOutput());
                final List<LinuxFile> files = new ArrayList<LinuxFile>();
                if (out.getExitCode() == 0) {
                    for (final String line : out.getOutput().split("\r\n")) {
                        if (line.trim().isEmpty()) {
                            continue;
                        }
                        final Matcher m = STAT_PATTERN.matcher(line);
                        if (m.matches()) {
View Full Code Here

                               + LCMC_TEST_FILE
                               + " 2>&1;echo '"
                               + PTEST_END_DELIM
                               + "';cat " + LCMC_TEST_FILE + " 2>/dev/null;"
                               + "mv -f " + LCMC_TEST_FILE + "{,.last} 2>/dev/null";
        final SshOutput output = host.captureCommand(new ExecCommandConfig().command(command)
                                                                            .silentCommand()
                                                                            .silentOutput());
        M_PTEST_WRITELOCK.lock();
        try {
            final String po = output.getOutput();
            if (ptestOutput == null) {
                ptestOutput = po;
            }
            return po;
        } finally {
View Full Code Here

                xml.append("</clone>");
            }
        }
        xml.append('\'');

        final SshOutput ret = execCommand(host, getCibCommand(command, "resources", xml.toString()), runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

            cibadminOpt = "-C";
        } else {
            cibadminOpt = "-R";
        }

        final SshOutput ret = execCommand(host, getCibCommand(cibadminOpt, "resources", xml.toString()), runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

TOP

Related Classes of lcmc.cluster.service.ssh.SshOutput

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.