Merge pull request #866 from ioito/bugfix/qx-openstack-region-fix

禁止OpenStack不同账号共享Region
This commit is contained in:
yunion-ci-robot
2019-05-20 22:39:18 +08:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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 {
+2 -2
View File
@@ -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 {