public String expandPasswordAlias(String alias) { String expandedPassword = null; if (alias == null) { return null; } try { expandedPassword = RelativePathResolver.getRealPasswordFromAlias(alias); } catch (Exception e) { logger.warning(StringUtils.cat(": ", alias, e.getMessage())); return null; } return expandedPassword; }
/** * Make sure we can make an SSH connection using an existing node. * * @param node Node to connect to * @throws CommandValidationException */ private void pingSSHConnection(Node node) throws CommandValidationException { try { sshL.init(node, logger); sshL.pingConnection(); } catch (Exception e) { String m1 = e.getMessage(); String m2 = ""; Throwable e2 = e.getCause(); if (e2 != null) { m2 = e2.getMessage(); } String msg = Strings.get("ssh.bad.connect", node.getNodeHost(), "SSH"); logger.warning(StringUtils.cat(": ", msg, m1, m2, sshL.toString())); throw new CommandValidationException(StringUtils.cat(NL, msg, m1, m2)); } }
/** * Make sure we can make an SSH connection using an existing node. * * @param node Node to connect to * @throws CommandValidationException */ void pingSSHConnection(Node node) throws CommandValidationException { validateHostName(node.getNodeHost()); try { sshL.init(node, logger); sshL.pingConnection(); } catch (Exception e) { String m1 = e.getMessage(); String m2 = ""; Throwable e2 = e.getCause(); if (e2 != null) { m2 = e2.getMessage(); } String msg = Strings.get("ssh.bad.connect", node.getNodeHost()); logger.warning(StringUtils.cat(": ", msg, m1, m2, sshL.toString())); throw new CommandValidationException(StringUtils.cat(NL, msg, m1, m2)); } }
instanceName, nodeHost); if (!terse) { msg = StringUtils.cat(NL, output.toString().trim(), msg);
instanceName, theNode.getNodeHost()); if (!terse) { msg = StringUtils.cat(NL, output.toString().trim(), msg);
instanceName, theNode.getNodeHost()); if (!terse) { msg = StringUtils.cat(NL, output.toString().trim(), msg);
instanceName, nodeHost); if (!terse) { msg = StringUtils.cat(NL, output.toString().trim(), msg);
logger.warning(StringUtils.cat(": ", msg1, msg2, msg3)); nodeName, nodeHost, ec.getCommandRun(), ec.getMessage(), ec.getSSHSettings()); logger.warning(StringUtils.cat(": ", msg1, msg, msg3)); } catch (ProcessManagerException ex) { msg2 = Strings.get("node.command.failed.local.details", ex.getMessage(), nr.getLastCommandRun()); logger.warning(StringUtils.cat(": ", msg1, msg2, msg3)); } catch (UnsupportedOperationException e) { msg2 = Strings.get("node.not.ssh", nodeName, nodeHost); logger.warning(StringUtils.cat(": ", msg1, msg2, msg3)); } catch (IllegalArgumentException e) { msg2 = e.getMessage(); logger.warning(StringUtils.cat(": ", msg1, msg2, msg3)); report.setMessage(StringUtils.cat(NL + NL, msg1, msg2, msg3)); report.setActionExitCode(ActionReport.ExitCode.FAILURE); } else {
logger.finer(StringUtils.cat(": ", alias, e.getMessage()));
logger.warning(StringUtils.cat(": ", m1, m2, sshL.toString())); if (!installFlag) throw new CommandValidationException(StringUtils.cat(NL, m1, m2)); } else { String msg = Strings.get("ssh.bad.connect", nodehost); logger.warning(StringUtils.cat(": ", msg, m1, m2, sshL.toString())); throw new CommandValidationException(StringUtils.cat(NL, msg, m1, m2));
if (!force) { String m2 = Strings.get("create.node.ssh.not.created"); msg.append(StringUtils.cat(NL, m1, m2, e.getMessage())); report.setMessage(msg.toString()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); } else { String m2 = Strings.get("create.node.ssh.continue.force"); msg.append(StringUtils.cat(NL, m1, e.getMessage(), m2));
String m1 = Strings.get("ping.node.failure", name, theNode.getNodeHost()); msg.append(StringUtils.cat(NL, m1, e.getMessage())); report.setMessage(msg.toString()); report.setActionExitCode(ActionReport.ExitCode.FAILURE);
if (!force) { String m2 = Strings.get("update.node.ssh.not.updated"); msg.append(StringUtils.cat(NL, m1, m2, e.getMessage())); report.setMessage(msg.toString()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); } else { String m2 = Strings.get("update.node.ssh.continue.force"); msg.append(StringUtils.cat(NL, m1, e.getMessage(), m2));
String m1 = Strings.get("ping.node.failure", name, theNode.getNodeHost(), theNode.getType()); msg.append(StringUtils.cat(NL, m1, e.getMessage())); report.setMessage(msg.toString()); report.setActionExitCode(ActionReport.ExitCode.FAILURE);
if (!force) { String m2 = Strings.get("update.node.ssh.not.updated"); msg.append(StringUtils.cat(NL, m1, m2, e.getMessage())); report.setMessage(msg.toString()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); } else { String m2 = Strings.get("update.node.ssh.continue.force"); msg.append(StringUtils.cat(NL, m1, e.getMessage(), m2));