Updated Branches: refs/heads/object_store 565bdfb27 -> b9378ae5a
Fix cache storage selection in case of zone scope id passed is null. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b9378ae5 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b9378ae5 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b9378ae5 Branch: refs/heads/object_store Commit: b9378ae5ad6e1b92d4954ec3228853e1a9b08e40 Parents: 565bdfb Author: Min Chen <[email protected]> Authored: Mon May 20 16:44:31 2013 -0700 Committer: Min Chen <[email protected]> Committed: Mon May 20 16:44:31 2013 -0700 ---------------------------------------------------------------------- .../storage/image/db/ImageStoreDaoImpl.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9378ae5/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java index e6a0e06..70316b9 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java @@ -95,8 +95,10 @@ public class ImageStoreDaoImpl extends GenericDaoBase<ImageStoreVO, Long> implem public List<ImageStoreVO> findImageCacheByScope(ZoneScope scope) { SearchCriteria<ImageStoreVO> sc = createSearchCriteria(); sc.addAnd("role", SearchCriteria.Op.EQ, DataStoreRole.ImageCache); - sc.addAnd("scope", SearchCriteria.Op.EQ, ScopeType.ZONE); - sc.addAnd("dcId", SearchCriteria.Op.EQ, scope.getScopeId()); + if (scope.getScopeId() != null) { + sc.addAnd("scope", SearchCriteria.Op.EQ, ScopeType.ZONE); + sc.addAnd("dcId", SearchCriteria.Op.EQ, scope.getScopeId()); + } return listBy(sc); }
