CLOUDSTACK-1551: Failed to list clusters due to NPE at createClusterResponse(ApiResponseHelper.java:837) when cluster is added automatically as a part of addHostCommand

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Bharat Kumar 2013-03-08 15:08:41 +05:30 committed by Abhinandan Prateek
parent 27b753a434
commit 6715f98087
1 changed files with 7 additions and 0 deletions

View File

@ -770,6 +770,13 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
}
}
clusterId = cluster.getId();
if (_clusterDetailsDao.findDetail(clusterId,"cpuOvercommitRatio") == null) {
ClusterDetailsVO cluster_cpu_detail = new ClusterDetailsVO(clusterId,"cpuOvercommitRatio","1");
ClusterDetailsVO cluster_memory_detail = new ClusterDetailsVO(clusterId,"memoryOvercommitRatio","1");
_clusterDetailsDao.persist(cluster_cpu_detail);
_clusterDetailsDao.persist(cluster_memory_detail);
}
}
try {