From 48ce6b7c0e78ee81f0d6b23ede1b49158b002e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Mon, 10 Sep 2018 16:42:39 +0800 Subject: [PATCH] =?UTF-8?q?protocol=E4=B8=BA=E7=A9=BA=E5=88=99=E6=8C=87?= =?UTF-8?q?=E5=AE=9Aprotocol=E4=B8=BAany?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/secgrouprules.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/compute/models/secgrouprules.go b/pkg/compute/models/secgrouprules.go index 46b032e195..24d83c9ba8 100644 --- a/pkg/compute/models/secgrouprules.go +++ b/pkg/compute/models/secgrouprules.go @@ -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 {