mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CS-14783
Fixed limit check when acquire public ip range for the account.
This commit is contained in:
parent
e6c764f149
commit
4f12a5191a
@ -2179,16 +2179,22 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
||||
if (forVirtualNetwork) {
|
||||
if (vlanOwner != null) {
|
||||
// verify resource limits
|
||||
long ipResourceLimit = _resourceLimitMgr.findCorrectResourceLimitForAccount(vlanOwner, ResourceType.public_ip);
|
||||
//long ipResourceLimit = _resourceLimitMgr.findCorrectResourceLimitForAccount(vlanOwner, ResourceType.public_ip);
|
||||
|
||||
long accountIpRange = NetUtils.ip2Long(endIP) - NetUtils.ip2Long(startIP) + 1;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(" IPResourceLimit " + ipResourceLimit + " accountIpRange " + accountIpRange);
|
||||
}
|
||||
if (ipResourceLimit != -1 && accountIpRange > ipResourceLimit) { // -1
|
||||
// means
|
||||
// infinite
|
||||
throw new InvalidParameterValueException(" Public IP Resource Limit is set to " + ipResourceLimit + " which is less than the IP range of " + accountIpRange + " provided");
|
||||
}
|
||||
|
||||
//check resource limits
|
||||
_resourceLimitMgr.checkResourceLimit(vlanOwner, ResourceType.public_ip, accountIpRange);
|
||||
|
||||
// if (s_logger.isDebugEnabled()) {
|
||||
// s_logger.debug(" IPResourceLimit " + ipResourceLimit + " accountIpRange " + accountIpRange);
|
||||
// }
|
||||
// if (ipResourceLimit != -1 && accountIpRange > ipResourceLimit) { // -1
|
||||
// // means
|
||||
// // infinite
|
||||
// throw new InvalidParameterValueException(" Public IP Resource Limit is set to " + ipResourceLimit +
|
||||
// " which is less than the IP range of " + accountIpRange + " provided");
|
||||
// }
|
||||
associateIpRangeToAccount = true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user