bug 8806: fixing list hypervisors

status 8806: resolved fixed
This commit is contained in:
abhishek 2011-03-02 08:45:26 -08:00
parent f3b58a4b0a
commit 68aa8c4eb7
2 changed files with 11 additions and 6 deletions

View File

@ -67,7 +67,7 @@ public class ClusterDaoImpl extends GenericDaoBase<ClusterVO, Long> implements C
PodSearch.done();
ZoneSearch = createSearchBuilder();
ZoneSearch.and("dataCenterId", ZoneSearch.entity().getPodId(), SearchCriteria.Op.EQ);
ZoneSearch.and("dataCenterId", ZoneSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
ZoneSearch.done();
AvailHyperSearch = createSearchBuilder();

View File

@ -4718,17 +4718,22 @@ public class ManagementServerImpl implements ManagementServer {
}
return hypers.split(",");
} else {
String[] result = null;
int i = 0;
List<ClusterVO> clustersForZone = _clusterDao.listByZoneId(zoneId);
if(clustersForZone != null && clustersForZone.size() > 0) {
result = new String[clustersForZone.size()];
int i = 0;
Set<String> result = new HashSet<String>();
for(ClusterVO cluster : clustersForZone) {
result[i++] = cluster.getHypervisorType().toString();
result.add(cluster.getHypervisorType().toString());
}
String[] resultArray = new String[result.size()];
for(String entity : result) {
resultArray[i++] = entity;
}
return resultArray;
}
return result;
}
return null;
}
@Override