Merge pull request #4204 from jtopjian/jtopjian-openstack-deleting-volume

provider/openstack: Handle volumes in "deleting" state
This commit is contained in:
Joe Topjian 2015-12-08 22:58:32 -07:00
commit 3dc45039d1
1 changed files with 7 additions and 3 deletions

View File

@ -259,9 +259,13 @@ func resourceBlockStorageVolumeV1Delete(d *schema.ResourceData, meta interface{}
} }
} }
err = volumes.Delete(blockStorageClient, d.Id()).ExtractErr() // It's possible that this volume was used as a boot device and is currently
if err != nil { // in a "deleting" state from when the instance was terminated.
return fmt.Errorf("Error deleting OpenStack volume: %s", err) // If this is true, just move on. It'll eventually delete.
if v.Status != "deleting" {
if err := volumes.Delete(blockStorageClient, d.Id()).ExtractErr(); err != nil {
return CheckDeleted(d, err, "volume")
}
} }
// Wait for the volume to delete before moving on. // Wait for the volume to delete before moving on.