use of com.cloud.vm.ItWorkVO.Step in project cosmic by MissionCriticalCloud.
the class VirtualMachineManagerImpl method changeState.
protected <T extends VMInstanceVO> boolean changeState(final T vm, final Event event, final Long hostId, final ItWorkVO work, final Step step) throws NoTransitionException {
// FIXME: We should do this better.
Step previousStep = null;
if (work != null) {
previousStep = work.getStep();
_workDao.updateStep(work, step);
}
boolean result = false;
try {
result = stateTransitTo(vm, event, hostId);
return result;
} finally {
if (!result && work != null) {
_workDao.updateStep(work, previousStep);
}
}
}
Aggregations