From 083324df06828e1b8fb97220b7415c2a28ee16c4 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 20 Mar 2014 06:48:45 -0700 Subject: [PATCH] Big Switch Plugin: No REST port delete on net del Moves the REST call for port deletion out of the _delete_port method into the delete_port method so it doesn't get called during a delete_network operation. The backend controller automatically removes ports that are a member of a network when it's deleted. Closes-Bug: #1295438 Change-Id: Ic09eb722f8e9bd3ce298dee90d8415cda1a1aa7a --- neutron/plugins/bigswitch/plugin.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/neutron/plugins/bigswitch/plugin.py b/neutron/plugins/bigswitch/plugin.py index ff6a28924..cdf8d2d8f 100644 --- a/neutron/plugins/bigswitch/plugin.py +++ b/neutron/plugins/bigswitch/plugin.py @@ -801,19 +801,11 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base, with context.session.begin(subtransactions=True): self.disassociate_floatingips(context, port_id) self._delete_port_security_group_bindings(context, port_id) - super(NeutronRestProxyV2, self).delete_port(context, port_id) - - def _delete_port(self, context, port_id): - port = super(NeutronRestProxyV2, self).get_port(context, port_id) - - # Tenant ID must come from network in case the network is shared - tenant_id = self._get_port_net_tenantid(context, port) - - # Delete from DB - ret_val = super(NeutronRestProxyV2, - self)._delete_port(context, port_id) - self.servers.rest_delete_port(tenant_id, port['network_id'], port_id) - return ret_val + port = super(NeutronRestProxyV2, self).get_port(context, port_id) + # Tenant ID must come from network in case the network is shared + tenid = self._get_port_net_tenantid(context, port) + self._delete_port(context, port_id) + self.servers.rest_delete_port(tenid, port['network_id'], port_id) def create_subnet(self, context, subnet): LOG.debug(_("NeutronRestProxyV2: create_subnet() called"))