Package lcmc.cluster.service.ssh

Examples of lcmc.cluster.service.ssh.ExecCommandConfig


                    });
                }
            }
        );

        getHost().execCommand(new ExecCommandConfig().commandString("ProxyCheck.version")
                                                .progressBar(getProgressBar())
                                                .execCallback(new ExecCallback() {
                                                    @Override
                                                    public void done(final String answer) {
                                                        checkProxyInstallation(answer);
View Full Code Here


            boolean confirm = false; /* confirm only once */
            for (final Host host : getBrowser().getClusterHosts()) {
                final String statCmd = DistResource.SUDO + "stat -c \"%F\" " + dir + "||true";
                final String text = statCmd.replaceAll(DistResource.SUDO, "");
                final SshOutput ret = host.captureCommandProgressIndicator(text,
                                                                           new ExecCommandConfig().command(statCmd));

                if (ret == null || !"directory".equals(ret.getOutput().trim())) {
                    String title = Tools.getString("ClusterBrowser.CreateDir.Title");
                    String desc  = Tools.getString("ClusterBrowser.CreateDir.Description");
                    title = title.replaceAll("@DIR@", dir);
                    title = title.replaceAll("@HOST@", host.getName());
                    desc  = desc.replaceAll("@DIR@", dir);
                    desc  = desc.replaceAll("@HOST@", host.getName());
                    if (confirm || application.confirmDialog(title,
                                                       desc,
                                                       Tools.getString("ClusterBrowser.CreateDir.Yes"),
                                                       Tools.getString("ClusterBrowser.CreateDir.No"))) {
                        final String cmd = DistResource.SUDO + "/bin/mkdir " + dir;
                        final String progressText = cmd.replaceAll(DistResource.SUDO, "");
                        final SshOutput out = host.captureCommandProgressIndicator(progressText,
                                                                                   new ExecCommandConfig().command(cmd));
                        confirm = true;
                    }
                }
            }
        }
View Full Code Here

        final String installMethod = getDrbdInstallation().getProxyInstallMethodIndex();
        if (installMethod != null) {
            installCommand = "ProxyInst.install." + installMethod;
        }

        getHost().execCommandInBash(new ExecCommandConfig()
                         .commandString(installCommand)
                         .progressBar(getProgressBar())
                         .execCallback(new ExecCallback() {
                             @Override
                             public void done(final String answer) {
View Full Code Here

    private static final String AUTHKEYS_CONF_PERMS = "0400";

    /** Executes specified command on the host. */
    private static void execCommand(final Host host, final String command) {
        host.execCommandProgressIndicator(Tools.getString("Openais.ExecutingCommand"),
                                          new ExecCommandConfig().command(command)
                                                                 .sshCommandTimeout(180000));
    }
View Full Code Here

    private static final String AUTHKEYS_CONF_PERMS = "0600";

    /** Executes specified command on the host. */
    private static void execCommand(final Host host, final String command) {
        host.execCommandProgressIndicator(Tools.getString("Heartbeat.ExecutingCommand"),
                                          new ExecCommandConfig().command(command)
                                                                 .sshCommandTimeout(180000));
    }
View Full Code Here

        if (workAround) {
            cmd = "Heartbeat.dopdWorkaround;;;Heartbeat.enableDopd";
        } else {
            cmd = "Heartbeat.enableDopd";
        }
        host.execCommand(new ExecCommandConfig().commandString(cmd)).block();
    }
View Full Code Here

    public static void switchToCorosync(final Host host) {
        final String command = host.getDistCommand("Heartbeat.deleteFromRc"
                                                   + ";;;Corosync.addToRc"
                                                   + ";;;Corosync.startCorosync",
                                                   (ConvertCmdCallback) null);
        host.execCommandProgressIndicator(PROGRESS_TEXT, new ExecCommandConfig().command(command));
    }
View Full Code Here

     * Starts corosync on host.
     * /etc/init.d/corosync start
     */
    public static void startCorosync(final Host host) {
        final String command = host.getDistCommand("Corosync.startCorosync", (ConvertCmdCallback) null);
        host.execCommandProgressIndicator(PROGRESS_TEXT, new ExecCommandConfig().command(command));
    }
View Full Code Here

     * Starts corosync with pacemaker on host.
     * /etc/init.d/corosync start && /etc/init.d/pacemaker start
     */
    public static void startCorosyncWithPcmk(final Host host) {
        final String command = host.getDistCommand("Corosync.startCorosyncWithPcmk", (ConvertCmdCallback) null);
        host.execCommandProgressIndicator(PROGRESS_TEXT, new ExecCommandConfig().command(command));
    }
View Full Code Here

     * Starts pacemaker on host.
     * /etc/init.d/pacemaker start
     */
    public static void startPacemaker(final Host host) {
        final String command = host.getDistCommand("Corosync.startPcmk", (ConvertCmdCallback) null);
        host.execCommandProgressIndicator(PROGRESS_TEXT, new ExecCommandConfig().command(command));
    }
View Full Code Here

TOP

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

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.