cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [3/4] git commit: updated refs/heads/object_store to 2c22488
Date Fri, 10 May 2013 04:49:30 GMT
Fix listImageStores to only list store with Image role, excluding those
cache stores since they are also stored in image_store table.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6f4fcf74
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6f4fcf74
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6f4fcf74

Branch: refs/heads/object_store
Commit: 6f4fcf741c864dbc6d0a1862eeff240a3e1640de
Parents: f965e2d
Author: Min Chen <min.chen@citrix.com>
Authored: Thu May 9 21:43:52 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu May 9 21:49:12 2013 -0700

----------------------------------------------------------------------
 .../storage/datastore/db/ImageStoreDao.java        |    2 +-
 .../manager/ImageStoreProviderManagerImpl.java     |    2 +-
 .../storage/image/db/ImageStoreDaoImpl.java        |    8 ++++++++
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f4fcf74/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
index bc6e029..4ac2ffc 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
@@ -31,5 +31,5 @@ public interface ImageStoreDao extends GenericDao<ImageStoreVO, Long>
{
     public List<ImageStoreVO> findByProvider(String provider);
     public List<ImageStoreVO> findByScope(ZoneScope scope);
     public List<ImageStoreVO> findImageCacheByScope(ZoneScope scope);
-
+    public List<ImageStoreVO> listImageStores();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f4fcf74/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
index a3dd930..43c02f6 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
@@ -92,7 +92,7 @@ public class ImageStoreProviderManagerImpl implements ImageStoreProviderManager
 
     @Override
     public List<DataStore> listImageStores() {
-        List<ImageStoreVO> stores = dataStoreDao.listAll();
+        List<ImageStoreVO> stores = dataStoreDao.listImageStores();
         List<DataStore> imageStores = new ArrayList<DataStore>();
         for (ImageStoreVO store : stores) {
             imageStores.add(getImageStore(store.getId()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f4fcf74/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 06b286f..31cf39f 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
@@ -96,4 +96,12 @@ public class ImageStoreDaoImpl extends GenericDaoBase<ImageStoreVO,
Long> implem
         return listBy(sc);
     }
 
+    @Override
+    public List<ImageStoreVO> listImageStores() {
+        SearchCriteria<ImageStoreVO> sc = createSearchCriteria();
+        sc.addAnd("role", SearchCriteria.Op.EQ, DataStoreRole.Image);
+        return listBy(sc);
+    }
+
+
 }


Mime
View raw message