} catch (IOException e) {
return NodeExecutorResultImpl.createFailure(StepFailureReason.IOFailure, e.getMessage(), node);
}
//first sudo prompt responder
ResponderTask responder = new ResponderTask(sudoResponder, responderInput, responderOutput, resultHandler);
/**
* Callable will be executed by the ExecutorService
*/
final Callable<ResponderTask.ResponderResult> responderResultCallable;
//if 2nd responder
final SudoResponder sudoResponder2 = SudoResponder.create(node, framework, context, SUDO2_OPT_PREFIX,
DEFAULT_SUDO2_PASSWORD_OPTION,
DEFAULT_SUDO2_COMMAND_PATTERN);
if (sudoResponder2.isSudoEnabled()
&& sudoResponder2.matchesCommandPattern(CLIUtils.generateArgline(null, command, false))) {
logger.debug("Enable second sudo responder");
sudoResponder2.setDescription("Second " + SudoResponder.DEFAULT_DESCRIPTION);
sudoResponder.setDescription("First " + SudoResponder.DEFAULT_DESCRIPTION);
//sequence of the first then the second sudo responder
responderResultCallable = responder.createSequence(sudoResponder2);
} else {
responderResultCallable = responder;
}