mirror of https://github.com/apache/cloudstack.git
bug 8458: check if attachISO is successful before update DB
status 8458: resolved fixed
This commit is contained in:
parent
5d796c718b
commit
ed197ae971
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue