mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
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
010858da0d
commit
09562e771c
@ -520,8 +520,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…
x
Reference in New Issue
Block a user