Updated Branches: refs/heads/master-6-17-stable 11a28aae4 -> b6484c3c4
Cloudstack-2732 [Multiple_IP_Ranges] Deleting guest IP range is not throwing any error message to user while the ip addresses are being used Signed-off-by: Jayapal <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b6484c3c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b6484c3c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b6484c3c Branch: refs/heads/master-6-17-stable Commit: b6484c3c42dcc979816c56423b4c389f13e7e524 Parents: 11a28aa Author: Bharat Kumar <[email protected]> Authored: Thu Jun 27 19:12:20 2013 +0530 Committer: Jayapal <[email protected]> Committed: Fri Jun 28 19:10:28 2013 +0530 ---------------------------------------------------------------------- server/src/com/cloud/configuration/ConfigurationManagerImpl.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b6484c3c/server/src/com/cloud/configuration/ConfigurationManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index c19f401..eba246f 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -3064,6 +3064,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } else { ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(vlanRange.getVlanGateway(), vlanRange.getNetworkId(), NicIpAlias.state.active); + if (ipAlias == null) { + throw new InvalidParameterValueException ("Cannot delete this range as some of the Ips are in use."); + } + //check if this ip belongs to this vlan and is allocated. ip = _publicIpAddressDao.findByIpAndVlanId(ipAlias.getIp4Address(), vlanDbId); if (ip != null && ip.getState() == IpAddress.State.Allocated) {
