From 306ebcf042e27c653ea97ef6ab7dd613dac8fb79 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 4 Sep 2013 21:29:07 -0700 Subject: [PATCH] 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. --- builder/digitalocean/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/digitalocean/api.go b/builder/digitalocean/api.go index 384b4e8c9..2118cf5ed 100644 --- a/builder/digitalocean/api.go +++ b/builder/digitalocean/api.go @@ -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)