mirror of https://github.com/apache/cloudstack.git
per angie, Below sequence doesn't work
1. copy template1 from z1 to z2 2. remove template1 from z2 3. copy tempalte1 from z1 to z2 again, 4. template1 for z2 doesn't show up in MyTemplate fixed
This commit is contained in:
parent
494f29702b
commit
c0f22970d3
|
|
@ -528,8 +528,15 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
if (tmplt2 == null){
|
||||
persist(tmplt);
|
||||
}
|
||||
VMTemplateZoneVO tmpltZoneVO = new VMTemplateZoneVO(zoneId, tmplt.getId(), new Date());
|
||||
_templateZoneDao.persist(tmpltZoneVO);
|
||||
VMTemplateZoneVO tmpltZoneVO = _templateZoneDao.findByZoneTemplate(zoneId, tmplt.getId());
|
||||
if ( tmpltZoneVO == null ) {
|
||||
tmpltZoneVO = new VMTemplateZoneVO(zoneId, tmplt.getId(), new Date());
|
||||
_templateZoneDao.persist(tmpltZoneVO);
|
||||
} else {
|
||||
tmpltZoneVO.setRemoved(null);
|
||||
tmpltZoneVO.setLastUpdated(new Date());
|
||||
_templateZoneDao.update(tmpltZoneVO.getId(), tmpltZoneVO);
|
||||
}
|
||||
txn.commit();
|
||||
|
||||
return tmplt.getId();
|
||||
|
|
|
|||
Loading…
Reference in New Issue