provider/openstack: Add SOFT_DELETED to delete status (#13444)
This commit allows clean deletion of instances that have a status of SOFT_DELETED.
This commit is contained in:
parent
7451166ae7
commit
cfd4101055
|
@ -919,7 +919,7 @@ func resourceComputeInstanceV2Delete(d *schema.ResourceData, meta interface{}) e
|
||||||
|
|
||||||
stateConf := &resource.StateChangeConf{
|
stateConf := &resource.StateChangeConf{
|
||||||
Pending: []string{"ACTIVE", "SHUTOFF"},
|
Pending: []string{"ACTIVE", "SHUTOFF"},
|
||||||
Target: []string{"DELETED"},
|
Target: []string{"DELETED", "SOFT_DELETED"},
|
||||||
Refresh: ServerV2StateRefreshFunc(computeClient, d.Id()),
|
Refresh: ServerV2StateRefreshFunc(computeClient, d.Id()),
|
||||||
Timeout: d.Timeout(schema.TimeoutDelete),
|
Timeout: d.Timeout(schema.TimeoutDelete),
|
||||||
Delay: 10 * time.Second,
|
Delay: 10 * time.Second,
|
||||||
|
|
|
@ -678,9 +678,11 @@ func testAccCheckComputeV2InstanceDestroy(s *terraform.State) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := servers.Get(computeClient, rs.Primary.ID).Extract()
|
server, err := servers.Get(computeClient, rs.Primary.ID).Extract()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return fmt.Errorf("Instance still exists")
|
if server.Status != "SOFT_DELETED" {
|
||||||
|
return fmt.Errorf("Instance still exists")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue