InternalLbVM: handle the scenario when sourceIpAddress is not passed when create internal Lb rule

This commit is contained in:
Alena Prokharchyk 2013-04-29 17:48:36 -07:00
parent 4c22c911a9
commit ed50caa01c
1 changed files with 6 additions and 6 deletions

View File

@ -236,14 +236,14 @@ public class ApplicationLoadBalancerManagerImpl extends ManagerBase implements A
* @return
* @throws InsufficientVirtualNetworkCapcityException
*/
protected Ip getSourceIp(Scheme scheme, Network sourceIpNtwk, String requestedIp) throws InsufficientVirtualNetworkCapcityException {
//Get source IP address
if (_lbDao.countBySourceIp(new Ip(requestedIp), sourceIpNtwk.getId()) > 0) {
s_logger.debug("IP address " + requestedIp + " is already used by existing LB rule, returning it");
return new Ip(requestedIp);
}
protected Ip getSourceIp(Scheme scheme, Network sourceIpNtwk, String requestedIp) throws InsufficientVirtualNetworkCapcityException {
if (requestedIp != null) {
if (_lbDao.countBySourceIp(new Ip(requestedIp), sourceIpNtwk.getId()) > 0) {
s_logger.debug("IP address " + requestedIp + " is already used by existing LB rule, returning it");
return new Ip(requestedIp);
}
validateRequestedSourceIpForLbRule(sourceIpNtwk, new Ip(requestedIp), scheme);
}