Bug 14370 - addSecondaryStorage always fails: "Can't find pod with specificied podId null"

status 14370: resolved fixed

Conflicts:

	server/src/com/cloud/resource/ResourceManagerImpl.java
This commit is contained in:
Salvatore Orlando 2012-03-19 17:14:03 +00:00
parent 906b40bf97
commit 6ca198e6f3
1 changed files with 8 additions and 3 deletions

View File

@ -546,8 +546,9 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
// Check if the pod exists in the system
if (podId != null) {
if (_podDao.findById(podId) == null) {
throw new InvalidParameterValueException("Can't find pod by id " + podId);
HostPodVO pod = _podDao.findById(podId);
if (pod == null) {
throw new InvalidParameterValueException("Can't find pod by id " + podId);
}
// check if pod belongs to the zone
HostPodVO pod = _podDao.findById(podId);
@ -595,7 +596,11 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
}
if (clusterName != null) {
ClusterVO cluster = new ClusterVO(dcId, podId, clusterName);
HostPodVO pod = _podDao.findById(podId);
if (pod == null) {
throw new InvalidParameterValueException("Can't find pod by id " + podId);
}
ClusterVO cluster = new ClusterVO(dcId, podId, clusterName);
cluster.setHypervisorType(hypervisorType);
try {
cluster = _clusterDao.persist(cluster);