builder/digitalocean: looser pending event string matching.

Most APIs return "has a pending event" but power off seems to return
"already a pending event". WTF. Also, just wtf at the DigitalOcean API.
I can't wait until they change their english and this breaks. Because
it is definitely going to happen, and it's going to be such a fun time.
This commit is contained in:
Mitchell Hashimoto 2013-09-04 21:29:07 -07:00
parent 524499f942
commit 306ebcf042
1 changed files with 1 additions and 1 deletions

View File

@ -233,7 +233,7 @@ func NewRequest(d DigitalOceanClient, path string, params url.Values) (map[strin
lastErr = errors.New(fmt.Sprintf("Received error from DigitalOcean (%d): %s",
resp.StatusCode, status))
log.Println(lastErr)
if strings.Contains(status, "has a pending event") {
if strings.Contains(status, "a pending event") {
// Retry, DigitalOcean sends these dumb "pending event"
// errors all the time.
time.Sleep(5 * time.Second)