mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix listImageStores to only list store with Image role, excluding those
cache stores since they are also stored in image_store table.
This commit is contained in:
parent
f965e2d892
commit
6f4fcf741c
@ -31,5 +31,5 @@ public interface ImageStoreDao extends GenericDao<ImageStoreVO, Long> {
|
|||||||
public List<ImageStoreVO> findByProvider(String provider);
|
public List<ImageStoreVO> findByProvider(String provider);
|
||||||
public List<ImageStoreVO> findByScope(ZoneScope scope);
|
public List<ImageStoreVO> findByScope(ZoneScope scope);
|
||||||
public List<ImageStoreVO> findImageCacheByScope(ZoneScope scope);
|
public List<ImageStoreVO> findImageCacheByScope(ZoneScope scope);
|
||||||
|
public List<ImageStoreVO> listImageStores();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,7 @@ public class ImageStoreProviderManagerImpl implements ImageStoreProviderManager
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DataStore> listImageStores() {
|
public List<DataStore> listImageStores() {
|
||||||
List<ImageStoreVO> stores = dataStoreDao.listAll();
|
List<ImageStoreVO> stores = dataStoreDao.listImageStores();
|
||||||
List<DataStore> imageStores = new ArrayList<DataStore>();
|
List<DataStore> imageStores = new ArrayList<DataStore>();
|
||||||
for (ImageStoreVO store : stores) {
|
for (ImageStoreVO store : stores) {
|
||||||
imageStores.add(getImageStore(store.getId()));
|
imageStores.add(getImageStore(store.getId()));
|
||||||
|
|||||||
@ -96,4 +96,12 @@ public class ImageStoreDaoImpl extends GenericDaoBase<ImageStoreVO, Long> implem
|
|||||||
return listBy(sc);
|
return listBy(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ImageStoreVO> listImageStores() {
|
||||||
|
SearchCriteria<ImageStoreVO> sc = createSearchCriteria();
|
||||||
|
sc.addAnd("role", SearchCriteria.Op.EQ, DataStoreRole.Image);
|
||||||
|
return listBy(sc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user