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.
pull/919/head
Mitchell Hashimoto 13 years ago
parent 524499f942
commit 306ebcf042

@ -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)

Loading…
Cancel
Save