]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix auto-deletion of ports when deleting subnets in ML2
authorBob Kukura <rkukura@redhat.com>
Thu, 3 Oct 2013 16:25:24 +0000 (12:25 -0400)
committerBob Kukura <rkukura@redhat.com>
Thu, 10 Oct 2013 03:52:16 +0000 (23:52 -0400)
commited78b563e13f1ed9189d7c4b9cd4317f2a50e734
tree4caea112154dff3436a3688e5f1029d7e1720c2a
parent54c756922216d27e1df69e30a484fc7881dce392
Fix auto-deletion of ports when deleting subnets in ML2

When a subnet is deleted, certain ports referencing it are
auto-deleted. The implementation of NeutronDBPluginV2.delete_subnet()
does this at the DB level, so ML2's mechanism drivers were not being
called.

Ml2Plugin.delete_subnet() is changed to not use the base class's
method, and to auto-delete ports by calling its own delete_port()
method outside of the transaction. A loop avoids race conditions with
ports being asynchronously added to the subnet.

The logic in Ml2Plugin.delete_network() is also fixed to properly
handle auto-deleting ports and subnets, and debug logging is added to
the various delete methods.

Closes-Bug: 1234195
Partial-Bug: 1235486
Change-Id: I6d74f89d39ea8afe6915f1d2f9afdf66c0076f5a
neutron/plugins/ml2/plugin.py