CLOUDSTACK-3314: templates downloaded to S3 should show up in listTemplates when zoneId is provided.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9a3067fb Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9a3067fb Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9a3067fb Branch: refs/heads/vmsync Commit: 9a3067fb87ee8bc1de66a02632e352e5e46e07ce Parents: 8a0470e Author: Min Chen <min.c...@citrix.com> Authored: Tue Jul 2 15:47:31 2013 -0700 Committer: Min Chen <min.c...@citrix.com> Committed: Tue Jul 2 15:47:49 2013 -0700 ---------------------------------------------------------------------- server/src/com/cloud/api/query/QueryManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a3067fb/server/src/com/cloud/api/query/QueryManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 18091aa..90a3b6f 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -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);