From 72f1e58833f2d639a4b79c63f8b2c8d5adf34bd5 Mon Sep 17 00:00:00 2001 From: TangBin Date: Fri, 6 Mar 2020 16:46:03 +0800 Subject: [PATCH] ctyun region name fix --- pkg/multicloud/ctyun/ctyun.go | 1 + pkg/multicloud/ctyun/region.go | 3 ++- pkg/multicloud/ctyun/zone.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/multicloud/ctyun/ctyun.go b/pkg/multicloud/ctyun/ctyun.go index 4b06f0c6df..ce120904c6 100644 --- a/pkg/multicloud/ctyun/ctyun.go +++ b/pkg/multicloud/ctyun/ctyun.go @@ -103,6 +103,7 @@ func (client *SCtyunClient) fetchRegions() error { Description: zone.ZoneName, ID: zone.RegionID, ParentRegionID: zone.RegionID, + RegionName: zone.ZoneName, izones: []cloudprovider.ICloudZone{&zone}, } diff --git a/pkg/multicloud/ctyun/region.go b/pkg/multicloud/ctyun/region.go index a119051a8e..d00fb8f3b9 100644 --- a/pkg/multicloud/ctyun/region.go +++ b/pkg/multicloud/ctyun/region.go @@ -35,6 +35,7 @@ type SRegion struct { client *SCtyunClient storageCache *SStoragecache + RegionName string Description string `json:"description"` ID string `json:"id"` ParentRegionID string `json:"parent_region_id"` @@ -162,7 +163,7 @@ func (self *SRegion) GetId() string { } func (self *SRegion) GetName() string { - return self.ID + return fmt.Sprintf("%s %s", CLOUD_PROVIDER_CTYUN_CN, self.RegionName) } func (self *SRegion) GetGlobalId() string { diff --git a/pkg/multicloud/ctyun/zone.go b/pkg/multicloud/ctyun/zone.go index e7276d4ff7..3202c54fe2 100644 --- a/pkg/multicloud/ctyun/zone.go +++ b/pkg/multicloud/ctyun/zone.go @@ -53,7 +53,7 @@ func (self *SZone) GetId() string { } func (self *SZone) GetName() string { - return self.ZoneName + return fmt.Sprintf("%s %s", CLOUD_PROVIDER_CTYUN_CN, self.ZoneID) } func (self *SZone) GetGlobalId() string {