mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
eliminating use of multiple variables; using the same var for all protocols (denoting ports for tcp/udp and type/code for icmp)
This commit is contained in:
parent
2e84e9fc92
commit
e28882b8ee
@ -613,21 +613,21 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
|
||||
return null;
|
||||
}
|
||||
}
|
||||
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndAllowedGroupId(securityGroup.getId(), protocol, startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, ngVO.getId());
|
||||
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndAllowedGroupId(securityGroup.getId(), protocol, startPortOrType, endPortOrCode, ngVO.getId());
|
||||
if (ingressRule != null) {
|
||||
continue; //rule already exists.
|
||||
}
|
||||
ingressRule = new IngressRuleVO(securityGroup.getId(), startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, protocol, ngVO.getId(), ngVO.getName(), ngVO.getAccountName());
|
||||
ingressRule = new IngressRuleVO(securityGroup.getId(), startPortOrType, 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 != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, cidr);
|
||||
IngressRuleVO ingressRule = _ingressRuleDao.findByProtoPortsAndCidr(securityGroup.getId(),protocol, startPortOrType, endPortOrCode, cidr);
|
||||
if (ingressRule != null) {
|
||||
continue;
|
||||
}
|
||||
ingressRule = new IngressRuleVO(securityGroup.getId(), startPort != null ? startPort : startPortOrType, endPort != null ? endPort : endPortOrCode, protocol, cidr);
|
||||
ingressRule = new IngressRuleVO(securityGroup.getId(), startPortOrType, endPortOrCode, protocol, cidr);
|
||||
ingressRule = _ingressRuleDao.persist(ingressRule);
|
||||
newRules.add(ingressRule);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user