Skip to content

Commit

Permalink
spread: rever change in {google,humbox,lindode}.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed Jul 5, 2023
1 parent 6adfc24 commit b08c9ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spread/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ func (p *googleProvider) GarbageCollect() error {
continue
}

printf("Checking google instance %s...", s)
printf("Checking %s...", s)

runningTime := now.Sub(s.d.Created)
if runningTime > serverTimeout {
Expand Down
2 changes: 1 addition & 1 deletion spread/humbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (p *humboxProvider) dofl(method, subpath string, params interface{}, result
}
req.Header.Set("Content-Type", "application/json")
req.SetBasicAuth(p.account, p.backend.Key)
resp, err = httpClient.Do(req)
resp, err = client.Do(req)
if err == nil && 500 <= resp.StatusCode && resp.StatusCode < 600 {
time.Sleep(time.Duration(delays[i]) * 250 * time.Millisecond)
continue
Expand Down
4 changes: 2 additions & 2 deletions spread/linode.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type linodeProvider struct {
}
}

var httpClient = &http.Client{}
var client = &http.Client{}

type linodeServer struct {
p *linodeProvider
Expand Down Expand Up @@ -1537,7 +1537,7 @@ func (p *linodeProvider) dofl(params linodeParams, result interface{}, flags doF
var resp *http.Response
var delays = rand.Perm(10)
for i := 0; i < 10; i++ {
resp, err = httpClient.PostForm("https://api.linode.com", values)
resp, err = client.PostForm("https://api.linode.com", values)
if err == nil && 500 <= resp.StatusCode && resp.StatusCode < 600 {
time.Sleep(time.Duration(delays[i]) * 250 * time.Millisecond)
continue
Expand Down
4 changes: 2 additions & 2 deletions spread/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"time"

"github.com/go-goose/goose/v5/client"
gooseClient "github.com/go-goose/goose/v5/client"
"github.com/go-goose/goose/v5/glance"
"github.com/go-goose/goose/v5/identity"
"github.com/go-goose/goose/v5/neutron"
Expand Down Expand Up @@ -595,7 +595,7 @@ func (p *openstackProvider) checkKey() error {
authmode = identity.AuthUserPass
}

authClient := client.NewClient(cred, authmode, nil)
authClient := gooseClient.NewClient(cred, authmode, nil)
err = authClient.Authenticate()
if err != nil {
return &FatalError{fmt.Errorf("failed to authenticate: %s", errorTitle(err.Error()))}
Expand Down

0 comments on commit b08c9ca

Please sign in to comment.