provider/openstack: gophercloud migration: Account for subnets and networks still in use

This commit is contained in:
Joe Topjian 2016-10-12 20:42:15 +00:00
parent 394c26c6cc
commit ea4209c61c
2 changed files with 10 additions and 0 deletions

View File

@ -244,6 +244,11 @@ func waitForNetworkDelete(networkingClient *gophercloud.ServiceClient, networkId
log.Printf("[DEBUG] Successfully deleted OpenStack Network %s", networkId)
return n, "DELETED", nil
}
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
if errCode.Actual == 409 {
return n, "ACTIVE", nil
}
}
return n, "ACTIVE", err
}

View File

@ -385,6 +385,11 @@ func waitForSubnetDelete(networkingClient *gophercloud.ServiceClient, subnetId s
log.Printf("[DEBUG] Successfully deleted OpenStack Subnet %s", subnetId)
return s, "DELETED", nil
}
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
if errCode.Actual == 409 {
return s, "ACTIVE", nil
}
}
return s, "ACTIVE", err
}