mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
避免创建vpc后wire同步异常
This commit is contained in:
@@ -171,12 +171,16 @@ func (region *SRegion) GetIStoragecaches() ([]cloudprovider.ICloudStoragecache,
|
||||
}
|
||||
|
||||
func (region *SRegion) GetIVpcById(id string) (cloudprovider.ICloudVpc, error) {
|
||||
vpc, err := region.GetVpc(id)
|
||||
ivpcs, err := region.GetIVpcs()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
vpc.region = region
|
||||
return vpc, nil
|
||||
for i := 0; i < len(ivpcs); i++ {
|
||||
if ivpcs[i].GetGlobalId() == id {
|
||||
return ivpcs[i], nil
|
||||
}
|
||||
}
|
||||
return nil, cloudprovider.ErrNotFound
|
||||
}
|
||||
|
||||
func (region *SRegion) GetIZoneById(id string) (cloudprovider.ICloudZone, error) {
|
||||
|
||||
Reference in New Issue
Block a user