providers/digitalocean: handle locked droplets and retry
This commit is contained in:
parent
9c164c6015
commit
ed8980714c
|
@ -325,6 +325,14 @@ func new_droplet_state_refresh_func(id string, attribute string, client *digital
|
|||
return nil, "", err
|
||||
}
|
||||
|
||||
// If the droplet is locked, continue waiting. We can
|
||||
// only perform actions on unlocked droplets, so it's
|
||||
// pointless to look at that status
|
||||
if droplet.IsLocked() == "true" {
|
||||
log.Println("[DEBUG] Droplet is locked, skipping status check and retrying")
|
||||
return nil, "", nil
|
||||
}
|
||||
|
||||
// Use our mapping to get back a map of the
|
||||
// droplet properties
|
||||
resourceMap, err := resource_digitalocean_droplet_update_state(
|
||||
|
|
|
@ -59,7 +59,7 @@ func TestAccDigitalOceanDroplet_Update(t *testing.T) {
|
|||
testAccCheckDigitalOceanDropletExists("digitalocean_droplet.foobar", &droplet),
|
||||
testAccCheckDigitalOceanDropletRenamedAndResized(&droplet),
|
||||
resource.TestCheckResourceAttr(
|
||||
"digitalocean_droplet.foobar", "name", "foo"),
|
||||
"digitalocean_droplet.foobar", "name", "baz"),
|
||||
resource.TestCheckResourceAttr(
|
||||
"digitalocean_droplet.foobar", "size", "1gb"),
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue