protocol为空则指定protocol为any

This commit is contained in:
屈轩
2018-09-10 16:42:39 +08:00
parent 2ca12923c0
commit 48ce6b7c0e
+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 {