From 01d5977bd6814620fc7661b6066d3fa925ecc17e Mon Sep 17 00:00:00 2001 From: TangBin Date: Fri, 25 Dec 2020 19:50:19 +0800 Subject: [PATCH] fix(region): aws sync vpc access mode bugfix --- pkg/cloudcommon/db/i18n.go | 7 +++++-- pkg/multicloud/aws/internetgateway.go | 1 - pkg/multicloud/aws/vpc.go | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/cloudcommon/db/i18n.go b/pkg/cloudcommon/db/i18n.go index c96b93df65..3cf9803990 100644 --- a/pkg/cloudcommon/db/i18n.go +++ b/pkg/cloudcommon/db/i18n.go @@ -286,6 +286,9 @@ func (self SI18n) GetExternalId() string { func (self *SI18n) Lookup(ctx context.Context) string { entry := i18n.NewTableEntry().CN(self.Cn).EN(self.En) - v, _ := entry.Lookup(ctx) - return v + if v, ok := entry.Lookup(ctx); ok { + return v + } + + return self.KeyValue } diff --git a/pkg/multicloud/aws/internetgateway.go b/pkg/multicloud/aws/internetgateway.go index 5854af0a7d..c473a194d2 100644 --- a/pkg/multicloud/aws/internetgateway.go +++ b/pkg/multicloud/aws/internetgateway.go @@ -14,7 +14,6 @@ type SInternetGateway struct { Attachments []InternetGatewayAttachment `json:"Attachments"` InternetGatewayID string `json:"InternetGatewayId"` OwnerID string `json:"OwnerId"` - Tags []interface{} `json:"Tags"` } type InternetGatewayAttachment struct { diff --git a/pkg/multicloud/aws/vpc.go b/pkg/multicloud/aws/vpc.go index 16c9a4dd49..fa2928b7aa 100644 --- a/pkg/multicloud/aws/vpc.go +++ b/pkg/multicloud/aws/vpc.go @@ -428,7 +428,6 @@ func (self *SVpc) GetExternalAccessMode() string { igws, err := self.region.GetInternetGateways(self.GetId()) if err != nil { log.Errorf("GetExternalAccessMode.GetInternetGateways %s", err) - } if len(igws) > 0 {