From 5140a0f7a6060e07c78e911b6f83bf5c19dce1b3 Mon Sep 17 00:00:00 2001 From: TangBin Date: Wed, 26 Feb 2020 16:25:50 +0800 Subject: [PATCH] ctyun eip charge type fix --- pkg/compute/models/elasticips.go | 4 +++- pkg/multicloud/ctyun/eip.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/compute/models/elasticips.go b/pkg/compute/models/elasticips.go index 8166c05e35..c520dd0932 100644 --- a/pkg/compute/models/elasticips.go +++ b/pkg/compute/models/elasticips.go @@ -366,7 +366,9 @@ func (self *SElasticip) SyncWithCloudEip(ctx context.Context, userCred mcclient. self.ExternalId = ext.GetGlobalId() self.IsEmulated = ext.IsEmulated() - self.ChargeType = ext.GetInternetChargeType() + if chargeType := ext.GetInternetChargeType(); len(chargeType) > 0 { + self.ChargeType = chargeType + } factory, _ := provider.GetProviderFactory() if factory != nil && factory.IsSupportPrepaidResources() { diff --git a/pkg/multicloud/ctyun/eip.go b/pkg/multicloud/ctyun/eip.go index d51ca6b67b..8cb4693dee 100644 --- a/pkg/multicloud/ctyun/eip.go +++ b/pkg/multicloud/ctyun/eip.go @@ -188,7 +188,7 @@ func (self *SEip) GetBandwidth() int { func (self *SEip) GetInternetChargeType() string { // todo: fix me - return api.EIP_CHARGE_TYPE_BY_BANDWIDTH + return "" } func (self *SEip) Delete() error {