Merge "Ensure conflicts creating subnet from subnetpools are retried"

This commit is contained in:
Zuul 2019-09-06 10:48:40 +00:00 committed by Gerrit Code Review
commit d6e92b759b
1 changed files with 17 additions and 11 deletions

View File

@ -144,6 +144,7 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
c_utils.tag_neutron_resources('networks', [neutron_net['id']])
# create a subnet within that network
try:
neutron_subnet = neutron.create_subnet(
{
"subnet": {
@ -155,6 +156,11 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
"project_id": project_id
}
}).get('subnet')
except n_exc.Conflict:
LOG.debug("Max number of retries on neutron side achieved, "
"raising ResourceNotReady to retry subnet creation "
"for %s", subnet_name)
raise exceptions.ResourceNotReady(subnet_name)
c_utils.tag_neutron_resources('subnets', [neutron_subnet['id']])
# connect the subnet to the router