CLOUDSTACK-3488: listStoragePools throws NPE if any of the storage pools are not in the right state.

This issue is reporducible if user adds a primary storage and quickly fires
listStoragePool API command without waiting for the responce of previous
createStoragePool API command. So during this period
(before receiving createStoragePool API resonce), the primary srorage is in
initialized status and the "scope" of storage is not set.
This commit is contained in:
Sanjay Tripathi 2013-07-23 10:42:48 +05:30 committed by Devdeep Singh
parent b466729008
commit f4eab352e0
1 changed files with 3 additions and 1 deletions

View File

@ -75,7 +75,9 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
poolResponse.setPodId(pool.getPodUuid());
poolResponse.setPodName(pool.getPodName());
poolResponse.setCreated(pool.getCreated());
poolResponse.setScope(pool.getScope().toString());
if (pool.getScope() != null) {
poolResponse.setScope(pool.getScope().toString());
}
if (pool.getHypervisor() != null) {
poolResponse.setHypervisor(pool.getHypervisor().toString());
}