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 <jayapal@apache.org>
This commit is contained in:
Bharat Kumar 2013-06-27 19:12:20 +05:30 committed by Jayapal
parent 6b0df2566d
commit 974245991c
1 changed files with 4 additions and 0 deletions

View File

@ -3267,6 +3267,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) {