Merge pull request #181 in YUNIONIO/onecloud from ~QUXUAN/onecloud:hotfix/qx-secgroup-rules to release/2.1.0

* commit '48ce6b7c0e78ee81f0d6b23ede1b49158b002e06':
  protocol为空则指定protocol为any
This commit is contained in:
邱剑
2018-09-10 23:53:54 +08:00
+2 -2
View File
@@ -374,8 +374,8 @@ func (manager *SSecurityGroupRuleManager) SyncRules(ctx context.Context, userCre
func (manager *SSecurityGroupRuleManager) newFromCloudSecurityGroup(rule secrules.SecurityRule, secgroup *SSecurityGroup) (*SSecurityGroupRule, error) {
protocol := rule.Protocol
if rule.Protocol == "any" {
protocol = ""
if len(protocol) == 0 {
protocol = secrules.PROTO_ANY
}
ports, _ports := "", make([]string, len(rule.Ports))
if len(rule.Ports) > 0 {