bug 7942: we were not using the right values for record creation when the proto=icmp. Using the right vals

status 7942: resolved fixed
This commit is contained in:
abhishek 2011-01-11 13:56:59 -08:00
parent 04e27c9d12
commit e4c3f556c2
1 changed files with 4 additions and 4 deletions

View File

@ -613,21 +613,21 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
return null;
}
}
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndAllowedGroupId(securityGroup.getId(), protocol, startPort, endPort, ngVO.getId());
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndAllowedGroupId(securityGroup.getId(), protocol, startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, ngVO.getId());
if (ingressRule != null) {
continue; //rule already exists.
}
ingressRule = new IngressRuleVO(securityGroup.getId(), startPort, endPort, protocol, ngVO.getId(), ngVO.getName(), ngVO.getAccountName());
ingressRule = new IngressRuleVO(securityGroup.getId(), startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, protocol, ngVO.getId(), ngVO.getName(), ngVO.getAccountName());
ingressRule = _ingressRuleDao.persist(ingressRule);
newRules.add(ingressRule);
}
if(cidrList != null) {
for (String cidr: cidrList) {
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndCidr(securityGroup.getId(),protocol, startPort, endPort, cidr);
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndCidr(securityGroup.getId(),protocol, startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, cidr);
if (ingressRule != null) {
continue;
}
ingressRule = new IngressRuleVO(securityGroup.getId(), startPort, endPort, protocol, cidr);
ingressRule = new IngressRuleVO(securityGroup.getId(), startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, protocol, cidr);
ingressRule = _ingressRuleDao.persist(ingressRule);
newRules.add(ingressRule);
}