mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
ctyun vpc create fix
This commit is contained in:
@@ -115,6 +115,7 @@ func (self *SRegion) CreateVpc(name, cidr string) (*SVpc, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
vpc.ResVpcID, _ = resp.GetString("returnObj", "id")
|
||||
vpc.region = self
|
||||
return vpc, nil
|
||||
}
|
||||
|
||||
@@ -204,6 +204,10 @@ func (self *SRegion) GetVpc(vpcId string) (*SVpc, error) {
|
||||
return nil, errors.Wrap(err, "SRegion.GetVpc.DoGet")
|
||||
}
|
||||
|
||||
if id, _ := resp.GetString("returnObj", "resVpcId"); len(id) == 0 {
|
||||
return nil, errors.Wrap(cloudprovider.ErrNotFound, "SRegion.GetVpc.GetID")
|
||||
}
|
||||
|
||||
err = resp.Unmarshal(vpc, "returnObj")
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "SRegion.GetVpc.Unmarshal")
|
||||
|
||||
Reference in New Issue
Block a user