use of org.ovirt.engine.core.common.vdscommands.SPMTaskGuidBaseVDSCommandParameters in project ovirt-engine by oVirt.
the class CoCoAsyncTaskHelper method revertTasks.
public void revertTasks(CommandBase<?> command) {
if (command.getParameters().getVdsmTaskIds() != null) {
// list to send to the pollTasks method
ArrayList<Guid> taskIdAsList = new ArrayList<>();
for (Guid taskId : command.getParameters().getVdsmTaskIds()) {
taskIdAsList.add(taskId);
ArrayList<AsyncTaskStatus> tasksStatuses = asyncTaskManager.get().pollTasks(taskIdAsList);
// call revert task only if ended successfully
if (tasksStatuses.get(0).getTaskEndedSuccessfully()) {
getBackend().getResourceManager().runVdsCommand(VDSCommandType.SPMRevertTask, new SPMTaskGuidBaseVDSCommandParameters(command.getStoragePool().getId(), taskId));
}
taskIdAsList.clear();
}
}
}
Aggregations