bug 10618: fixed NPE

status 10618: resolved fixed
This commit is contained in:
anthony 2011-07-07 10:15:45 -07:00
parent 9f13b46d61
commit 9b640085ab

View File

@ -267,16 +267,17 @@ public class StatsCollector {
}
List<HostVO> hosts = _hostDao.listSecondaryStorageHosts();
ConcurrentHashMap<Long, StorageStats> storageStats = new ConcurrentHashMap<Long, StorageStats>();
for (HostVO host : hosts) {
ConcurrentHashMap<Long, StorageStats> storageStats = new ConcurrentHashMap<Long, StorageStats>();
for (HostVO host : hosts) {
if ( host.getStorageUrl() == null ) {
continue;
}
GetStorageStatsCommand command = new GetStorageStatsCommand(host.getStorageUrl());
HostVO ssAhost = _agentMgr.getSSAgent(host);
if( ssAhost == null ) {
s_logger.warn("There is no secondary storage VM for secondary storage host " + host.getName());
continue;
}
HostVO ssAhost = _agentMgr.getSSAgent(host);
if (ssAhost == null) {
s_logger.warn("There is no secondary storage VM for secondary storage host " + host.getName());
continue;
}
long hostId = host.getId();
Answer answer = _agentMgr.easySend(ssAhost.getId(), command);
if (answer != null && answer.getResult()) {