From 209b7a540f3c0e8b882d44933eb405eb190bbfc3 Mon Sep 17 00:00:00 2001 From: ioito Date: Mon, 20 May 2019 21:49:40 +0800 Subject: [PATCH] fix openstack region sync --- pkg/util/openstack/region.go | 4 ++-- pkg/util/openstack/zone.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/util/openstack/region.go b/pkg/util/openstack/region.go index e15cb33438..d5032b2f2c 100644 --- a/pkg/util/openstack/region.go +++ b/pkg/util/openstack/region.go @@ -51,11 +51,11 @@ func (region *SRegion) GetId() string { } func (region *SRegion) GetName() string { - return fmt.Sprintf("%s %s", CLOUD_PROVIDER_OPENSTACK, region.Name) + return fmt.Sprintf("%s-%s", region.client.providerName, region.Name) } func (region *SRegion) GetGlobalId() string { - return fmt.Sprintf("%s/%s", CLOUD_PROVIDER_OPENSTACK, region.Name) + return fmt.Sprintf("%s/%s/%s", CLOUD_PROVIDER_OPENSTACK, region.Name, region.client.providerID) } func (region *SRegion) IsEmulated() bool { diff --git a/pkg/util/openstack/zone.go b/pkg/util/openstack/zone.go index d3c562fa7d..6fc4350c01 100644 --- a/pkg/util/openstack/zone.go +++ b/pkg/util/openstack/zone.go @@ -62,11 +62,11 @@ func (zone *SZone) GetId() string { } func (zone *SZone) GetName() string { - return fmt.Sprintf("%s %s", CLOUD_PROVIDER_OPENSTACK, zone.ZoneName) + return zone.ZoneName } func (zone *SZone) GetGlobalId() string { - return fmt.Sprintf("%s/%s", zone.region.GetGlobalId(), zone.ZoneName) + return fmt.Sprintf("%s/%s/%s", CLOUD_PROVIDER_OPENSTACK, zone.region.Name, zone.ZoneName) } func (zone *SZone) IsEmulated() bool {