mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix:qcloud vpc peer error wrap
This commit is contained in:
@@ -247,7 +247,7 @@ func (self *SVpc) CreateCrossRegionSVpcPeeringConnection(opts *cloudprovider.Vpc
|
||||
}
|
||||
//任务的当前状态。0:成功,1:失败,2:进行中。
|
||||
if status == 1 {
|
||||
return false, errors.Wrap(fmt.Errorf("taskfailed,taskId=%s", taskId), "client.DescribeVpcTaskResult(taskId)")
|
||||
return false, errors.Wrapf(fmt.Errorf("taskfailed,taskId=%d", taskId), "client.DescribeVpcTaskResult(taskId)")
|
||||
}
|
||||
if status == 0 {
|
||||
return true, nil
|
||||
@@ -255,7 +255,7 @@ func (self *SVpc) CreateCrossRegionSVpcPeeringConnection(opts *cloudprovider.Vpc
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, " cloudprovider.Wait %s", taskId)
|
||||
return nil, errors.Wrapf(err, "cloudprovider.Wait %d", taskId)
|
||||
}
|
||||
svpcPCs, err := self.GetSVpcPeeringConnections()
|
||||
if err != nil {
|
||||
@@ -289,7 +289,7 @@ func (self *SVpc) AcceptCrossRegionSVpcPeeringConnection(id string) error {
|
||||
}
|
||||
//任务的当前状态。0:成功,1:失败,2:进行中。
|
||||
if status == 1 {
|
||||
return false, errors.Wrap(fmt.Errorf("taskfailed,taskId=%s", taskId), "client.DescribeVpcTaskResult(taskId)")
|
||||
return false, errors.Wrap(fmt.Errorf("taskfailed,taskId=%d", taskId), "client.DescribeVpcTaskResult(taskId)")
|
||||
}
|
||||
if status == 0 {
|
||||
return true, nil
|
||||
@@ -297,7 +297,7 @@ func (self *SVpc) AcceptCrossRegionSVpcPeeringConnection(id string) error {
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, " cloudprovider.Wait %s", taskId)
|
||||
return errors.Wrapf(err, " cloudprovider.Wait %d", taskId)
|
||||
}
|
||||
svpcPC, err := self.GetSVpcPeeringConnectionById(id)
|
||||
if err != nil {
|
||||
|
||||
@@ -59,7 +59,7 @@ func (region *SRegion) DescribeVpcPeeringConnections(vpcId string, peeringConnec
|
||||
}
|
||||
body, err := region.vpc2017Request("DescribeVpcPeeringConnections", params)
|
||||
if err != nil {
|
||||
return nil, 0, errors.Wrapf(err, `region.vpcRequest("DescribeVpcPeeringConnections", params)`, jsonutils.Marshal(params).String())
|
||||
return nil, 0, errors.Wrapf(err, `region.vpcRequest("DescribeVpcPeeringConnections", %s)`, jsonutils.Marshal(params).String())
|
||||
}
|
||||
|
||||
total, _ := body.Float("totalCount")
|
||||
@@ -80,7 +80,7 @@ func (region *SRegion) GetAllVpcPeeringConnections(vpcId string) ([]SVpcPC, erro
|
||||
for {
|
||||
vpcPCS, total, err := region.DescribeVpcPeeringConnections(vpcId, "", len(result), 50)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, `client.DescribeVpcPeeringConnections(%s,"",%d,50)`, vpcId, len(result), len(result))
|
||||
return nil, errors.Wrapf(err, `client.DescribeVpcPeeringConnections(%s,"",%d,50)`, vpcId, len(result))
|
||||
}
|
||||
result = append(result, vpcPCS...)
|
||||
if total <= len(result) {
|
||||
@@ -261,7 +261,7 @@ func (self *SVpcPC) Delete() error {
|
||||
}
|
||||
//任务的当前状态。0:成功,1:失败,2:进行中。
|
||||
if status == 1 {
|
||||
return false, errors.Wrap(fmt.Errorf("taskfailed,taskId=%s", taskId), "client.DescribeVpcTaskResult(taskId)")
|
||||
return false, errors.Wrap(fmt.Errorf("taskfailed,taskId=%d", taskId), "client.DescribeVpcTaskResult(taskId)")
|
||||
}
|
||||
if status == 0 {
|
||||
return true, nil
|
||||
@@ -269,7 +269,7 @@ func (self *SVpcPC) Delete() error {
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "self.region.WaitTask(%s)", taskId)
|
||||
return errors.Wrapf(err, "self.region.WaitTask(%d)", taskId)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func (self *SVpc) CreateICloudVpcPeeringConnection(opts *cloudprovider.VpcPeerin
|
||||
}
|
||||
|
||||
func (self *SVpc) AcceptICloudVpcPeeringConnection(id string) error {
|
||||
return errors.Wrapf(cloudprovider.ErrNotImplemented, "AcceptICloudVpcPeeringConnection", id)
|
||||
return errors.Wrapf(cloudprovider.ErrNotImplemented, "AcceptICloudVpcPeeringConnection")
|
||||
}
|
||||
|
||||
func (self *SVpc) GetAuthorityOwnerId() string {
|
||||
|
||||
Reference in New Issue
Block a user