CLOUDSTACK-3314: templates downloaded to S3 should show up in

listTemplates when zoneId is provided.
This commit is contained in:
Min Chen 2013-07-02 15:47:31 -07:00
parent 8a0470ee0f
commit 9a3067fb87
1 changed files with 2 additions and 1 deletions

View File

@ -2877,7 +2877,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
if (zoneId != null) {
SearchCriteria<TemplateJoinVO> zoneSc = _templateJoinDao.createSearchCriteria();
zoneSc.addAnd("dataCenterId", SearchCriteria.Op.EQ, zoneId);
zoneSc.addOr("dataCenterId", SearchCriteria.Op.EQ, zoneId);
zoneSc.addOr("dataStoreScope", SearchCriteria.Op.EQ, ScopeType.REGION);
// handle the case where xs-tools.iso and vmware-tools.iso do not have data_center information in template_view
SearchCriteria<TemplateJoinVO> isoPerhostSc = _templateJoinDao.createSearchCriteria();
isoPerhostSc.addAnd("format", SearchCriteria.Op.EQ, ImageFormat.ISO);