{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3748","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3748/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3748/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3748/events","html_url":"https://github.com/hashicorp/terraform/pull/3748","id":115026123,"number":3748,"title":"provider/digitalocean : Floating IPs","user":{"login":"stack72","id":227823,"avatar_url":"https://avatars.githubusercontent.com/u/227823?v=3","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/digitalocean","name":"provider/digitalocean","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-11-04T10:53:03Z","updated_at":"2015-11-20T22:55:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/3748","html_url":"https://github.com/hashicorp/terraform/pull/3748","diff_url":"https://github.com/hashicorp/terraform/pull/3748.diff","patch_url":"https://github.com/hashicorp/terraform/pull/3748.patch"},"body":"* [x] schema\r\n* [x] Acceptance Tests\r\n* [x] Documentation\r\n\r\nThere is a potential race condition in the Acceptance Test that means we may not be able to destroy the Floating IP at the end of the test as it is still being assigned and that event has not been marked as complete\r\n\r\nTo get around this, I had to sacrifice some kittens and add a time.Sleep. This really upsets me but I cannot find any way around the need to wait a little bit for these changes to propagate :( \r\n\r\n@phinze I'd love some advice about whether this is actually a good thing in the TF codebase\r\n\r\nThis acceptance tests now work as follows:\r\n\r\n```\r\nmake testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=DigitalOceanFloatingIP' 2>~/tf.log\r\ngo generate ./...\r\nTF_ACC=1 go test ./builtin/providers/digitalocean -v -run=DigitalOceanFloatingIP -timeout 90m\r\n=== RUN   TestAccDigitalOceanFloatingIP_Region\r\n--- PASS: TestAccDigitalOceanFloatingIP_Region (24.08s)\r\n=== RUN   TestAccDigitalOceanFloatingIP_Droplet\r\n--- PASS: TestAccDigitalOceanFloatingIP_Droplet (93.20s)\r\nPASS\r\nok  \tgithub.com/hashicorp/terraform/builtin/providers/digitalocean\t117.288s\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/158550852","html_url":"https://github.com/hashicorp/terraform/pull/3748#issuecomment-158550852","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3748","id":158550852,"user":{"login":"stack72","id":227823,"avatar_url":"https://avatars.githubusercontent.com/u/227823?v=3","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T22:55:58Z","updated_at":"2015-11-20T22:55:58Z","body":"So the code now looks as follows:\r\n\r\n```\r\ndropletOpts := &godo.FloatingIPCreateRequest{\r\n\t\t\tDropletID: v.(int),\r\n\t\t}\r\n\r\n\t\tlog.Printf(\"[INFO] Creating FloatingIP\")\r\n\t\tipResp, _, err := client.FloatingIPs.Create(dropletOpts)\r\n\t\tif err != nil {\r\n\t\t\treturn fmt.Errorf(\"Error Creating FloatingIP: %s\", err)\r\n\t\t}\r\n\r\n\t\tlog.Printf(\"[INFO] Assigning the Floating IP to the Droplet\")\r\n\t\tactions, _, err := client.FloatingIPActions.List(ipResp.IP)\r\n\t\tif err != nil {\r\n\t\t\treturn fmt.Errorf(\r\n\t\t\t\t\"Error Getting the Actions of the FloatingIP (%s): %s\", ipResp.IP, err)\r\n\t\t}\r\n\r\n\t\t_, unassignedErr := waitForFloatingIPReady(d, \"completed\", []string{\"new\"}, \"status\", meta, actions[0].ID)\r\n\t\tif unassignedErr != nil {\r\n\t\t\treturn fmt.Errorf(\r\n\t\t\t\t\"Error waiting for FloatingIP (%s) to be assigned: \\n%s\", ipResp.IP, unassignedErr)\r\n\t\t}\r\n```\r\n\r\nI am assuming that I shouldn't just use the `actions[0].ID` and range through the actions to match for the correct action - right?"}}