use of com.iwave.ext.command.Command in project coprhd-controller by CoprHD.
the class SecureShellSupport method executeCommand.
public CommandOutput executeCommand(String commandString) {
Command command = new Command();
command.setCommand(commandString);
executeCommand(command);
return command.getOutput();
}
use of com.iwave.ext.command.Command in project coprhd-controller by CoprHD.
the class ShellCommandExecutor method executeCommands.
public List<CommandOutput> executeCommands(List<? extends Command> commands) throws CommandException {
List<CommandOutput> results = Lists.newArrayList();
for (Command command : commands) {
command.setCommandExecutor(this);
command.execute();
results.add(command.getOutput());
}
return results;
}
use of com.iwave.ext.command.Command in project coprhd-controller by CoprHD.
the class CustomServicesRemoteAnsibleExecution method executeRemoteCmd.
// Execute Ansible playbook on remote node. Playbook is also in remote node
private CommandOutput executeRemoteCmd(final String extraVars, final CustomServicesDBRemoteAnsiblePrimitive primitive) {
final Map<String, CustomServicesWorkflowDocument.InputGroup> inputType = step.getInputGroups();
if (inputType == null) {
return null;
}
logger.debug("user:{} password:{}", AnsibleHelper.getOptions(CustomServicesConstants.REMOTE_USER, input), AnsibleHelper.getOptions(CustomServicesConstants.REMOTE_PASSWORD, input));
final SSHCommandExecutor executor = new SSHCommandExecutor(AnsibleHelper.getOptions(CustomServicesConstants.REMOTE_NODE, input), 22, AnsibleHelper.getOptions(CustomServicesConstants.REMOTE_USER, input), AnsibleHelper.getOptions(CustomServicesConstants.REMOTE_PASSWORD, input));
executor.setCommandTimeout((int) timeout);
final Command command = new RemoteCommand(extraVars, input, primitive);
command.setCommandExecutor(executor);
command.execute();
return command.getOutput();
}
Aggregations