Merge pull request #1842 from anshul1886/CLOUDSTACK-9686

CLOUDSTACK-9686: Fixed multiple entires for builtin template in template
This commit is contained in:
Rajani Karuturi 2017-05-17 10:39:45 +05:30 committed by GitHub
commit 0fefc207f0

View File

@ -265,7 +265,7 @@ public class TemplateServiceImpl implements TemplateService {
for (VMTemplateVO template : toBeDownloaded) { for (VMTemplateVO template : toBeDownloaded) {
TemplateDataStoreVO tmpltHost = _vmTemplateStoreDao.findByStoreTemplate(store.getId(), template.getId()); TemplateDataStoreVO tmpltHost = _vmTemplateStoreDao.findByStoreTemplate(store.getId(), template.getId());
if (tmpltHost == null || tmpltHost.getState() != ObjectInDataStoreStateMachine.State.Ready) { if (tmpltHost == null) {
associateTemplateToZone(template.getId(), dcId); associateTemplateToZone(template.getId(), dcId);
s_logger.info("Downloading builtin template " + template.getUniqueName() + " to data center: " + dcId); s_logger.info("Downloading builtin template " + template.getUniqueName() + " to data center: " + dcId);
TemplateInfo tmplt = _templateFactory.getTemplate(template.getId(), DataStoreRole.Image); TemplateInfo tmplt = _templateFactory.getTemplate(template.getId(), DataStoreRole.Image);