aws backendgroup delete bugfix

This commit is contained in:
TangBin
2020-01-14 15:25:54 +08:00
parent aa55b51106
commit 90a541b9bf
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -61,6 +61,11 @@ func WaitStatusWithInstanceErrorCheck(res ICloudResource, expect string, interva
return ErrTimeout
}
func WaitDeletedWithDelay(res ICloudResource, delay time.Duration, interval time.Duration, timeout time.Duration) error {
time.Sleep(delay)
return WaitDeleted(res, interval, timeout)
}
func WaitDeleted(res ICloudResource, interval time.Duration, timeout time.Duration) error {
startTime := time.Now()
for time.Now().Sub(startTime) < timeout {
+6
View File
@@ -20,6 +20,7 @@ import (
"fmt"
"regexp"
"strings"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
@@ -1217,6 +1218,11 @@ func (self *SAwsRegionDriver) RequestDeleteLoadbalancer(ctx context.Context, use
}
}
err = cloudprovider.WaitDeletedWithDelay(iLoadbalancer, 10*time.Second, 10*time.Second, 60*time.Second)
if err != nil {
return nil, errors.Wrap(err, "AwsRegionDriver.RequestDeleteLoadbalancer.WaitDeleted")
}
// delete backendgroups
{
// delete remote lbbgs