bug 8458: check if attachISO is successful before update DB

status 8458: resolved fixed
This commit is contained in:
anthony 2011-02-07 17:33:11 -08:00
parent 5d796c718b
commit ed197ae971
1 changed files with 8 additions and 8 deletions

View File

@ -1185,14 +1185,14 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
VMTemplateVO iso = _tmpltDao.findById(isoId);
boolean success = _vmMgr.attachISOToVM(vmId, isoId, attach);
if (attach) {
vm.setIsoId(iso.getId());
} else {
vm.setIsoId(null);
}
_userVmDao.update(vmId, vm);
if ( success ) {
if (attach) {
vm.setIsoId(iso.getId());
} else {
vm.setIsoId(null);
}
_userVmDao.update(vmId, vm);
}
return success;
}