From 47a562a2c043c32fdf1f3108552cfce170b8b27e Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Tue, 21 May 2013 12:21:01 +0530 Subject: [PATCH] Cloudstack-2548: Failed to delete public IP range Public IP range deletion after it is dedicated fails with IP range being used for DHCP offers. Signed-off-by: Prasanna Santhanam --- .../cloud/configuration/ConfigurationManagerImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 47c54822adb..214e292963f 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -3071,9 +3071,16 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } } + } else { + // when there is no dhcp support in the network. + if (!deletePublicIPRange(vlanDbId)) { + return false; + } + _vlanDao.expunge(vlanDbId); + return true; } } - throw new InvalidParameterValueException("One of the ips in the range is used to provide Dhcp service to this subnet. cannot delete this range as "); + return false; }