From b3579b0a55fc432f1e25ea9bf26132a65cae4570 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Mon, 16 Jan 2012 14:47:13 +0530 Subject: [PATCH] bug 13096 Make capacity deletion for pod deletion more robust. Reviewed by : Kishan. --- .../cloud/configuration/ConfigurationManagerImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index cb8cdbfdcfe..bb430fe27b3 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -682,10 +682,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); + } } // Delete link local ip addresses for the pod @@ -703,7 +700,10 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura _vlanDao.remove(vlan.getId()); } } - + + // Delete corresponding capacity records + _capacityDao.removeBy(null, null, podId, null); + // Delete the pod if (!(_podDao.remove(podId))) { throw new CloudRuntimeException("Failed to delete pod " + podId);