mirror of https://github.com/apache/cloudstack.git
Internal LB: applyLoadBalancerRules - put not null check for sourceIpAddressId (can be null when Schema is not Public)
This commit is contained in:
parent
87e5f5b9a6
commit
20beb7a16c
|
|
@ -734,7 +734,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
|
||||
@Override
|
||||
public VirtualRouterProvider addElement(Long nspId, VirtualRouterProviderType providerType) {
|
||||
if (!(providerType != VirtualRouterProviderType.VirtualRouter) || (providerType != VirtualRouterProviderType.VPCVirtualRouter)) {
|
||||
if (!(providerType == VirtualRouterProviderType.VirtualRouter || providerType == VirtualRouterProviderType.VPCVirtualRouter)) {
|
||||
throw new InvalidParameterValueException("Element " + this.getName() + " supports only providerTypes: " +
|
||||
VirtualRouterProviderType.VirtualRouter.toString() + " and " + VirtualRouterProviderType.VPCVirtualRouter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1621,8 +1621,10 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||
}
|
||||
// if the rule is the last one for the ip address assigned to
|
||||
// VPC, unassign it from the network
|
||||
IpAddress ip = _ipAddressDao.findById(lb.getSourceIpAddressId());
|
||||
_vpcMgr.unassignIPFromVpcNetwork(ip.getId(), lb.getNetworkId());
|
||||
if (lb.getSourceIpAddressId() != null) {
|
||||
IpAddress ip = _ipAddressDao.findById(lb.getSourceIpAddressId());
|
||||
_vpcMgr.unassignIPFromVpcNetwork(ip.getId(), lb.getNetworkId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue