CLOUDSTACK-2510: Getting NPE while executinng listStoragePools API command.

This commit is contained in:
Sanjay Tripathi 2013-07-02 10:45:49 +05:30 committed by Devdeep Singh
parent 5e579c37fc
commit 6770c5d92d
1 changed files with 1 additions and 0 deletions

View File

@ -364,6 +364,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore
List<HostVO> allHosts = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.Routing, primarystore.getClusterId(),
primarystore.getPodId(), primarystore.getDataCenterId());
if (allHosts.isEmpty()) {
primaryDataStoreDao.expunge(primarystore.getId());
throw new CloudRuntimeException("No host up to associate a storage pool with in cluster "
+ primarystore.getClusterId());
}