bug 13096 Make capacity deletion for pod deletion more robust.

Reviewed by : Kishan.
This commit is contained in:
Nitin Mehta 2012-01-16 14:29:51 +05:30
parent 9f428e3817
commit 8a3a4ab9c0
1 changed files with 5 additions and 5 deletions

View File

@ -739,10 +739,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
if (!privateIps.isEmpty()) {
if (!(_privateIpAddressDao.deleteIpAddressByPod(podId))) {
throw new CloudRuntimeException("Failed to cleanup private ip addresses for pod " + podId);
}
// Delete corresponding capacity record
_capacityDao.removeBy(Capacity.CAPACITY_TYPE_PRIVATE_IP, null, podId, null, null);
}
}
// Delete link local ip addresses for the pod
@ -760,7 +757,10 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
_vlanDao.remove(vlan.getId());
}
}
// Delete corresponding capacity records
_capacityDao.removeBy(null, null, podId, null, null);
// Delete the pod
if (!(_podDao.remove(podId))) {
throw new CloudRuntimeException("Failed to delete pod " + podId);