Automatic merge from release/2.4.0 -> release/2.5.0

* commit '082b003451edd9ad303b328494cc9ae2e2c5478b':
  避免PortStart为-1时未正确设置PortRange参数
This commit is contained in:
邱剑
2019-01-10 19:40:27 +08:00
+3 -3
View File
@@ -248,7 +248,7 @@ func (self *SRegion) modifySecurityGroupRule(secGrpId string, rule *secrules.Sec
protocol = "all"
}
params["IpProtocol"] = protocol
if rule.PortStart == 0 && rule.PortEnd == 0 {
if rule.PortStart < 1 && rule.PortEnd < 1 {
if protocol == "udp" || protocol == "tcp" {
params["PortRange"] = "1/65535"
} else {
@@ -320,7 +320,7 @@ func (self *SRegion) addSecurityGroupRule(secGrpId string, rule *secrules.Securi
protocol = "all"
}
params["IpProtocol"] = protocol
if rule.PortStart == 0 && rule.PortEnd == 0 {
if rule.PortStart < 1 && rule.PortEnd < 1 {
if protocol == "udp" || protocol == "tcp" {
params["PortRange"] = "1/65535"
} else {
@@ -363,7 +363,7 @@ func (self *SRegion) delSecurityGroupRule(secGrpId string, rule *secrules.Securi
protocol = "all"
}
params["IpProtocol"] = protocol
if rule.PortStart == 0 && rule.PortEnd == 0 {
if rule.PortStart < 1 && rule.PortEnd < 1 {
if protocol == "udp" || protocol == "tcp" {
params["PortRange"] = "1/65535"
} else {