]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Big Switch Plugin: No REST port delete on net del
authorKevin Benton <blak111@gmail.com>
Thu, 20 Mar 2014 13:48:45 +0000 (06:48 -0700)
committerKevin Benton <blak111@gmail.com>
Fri, 21 Mar 2014 05:16:42 +0000 (22:16 -0700)
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

index ff6a289243f3d974fde8b67cec3b19214cf260d0..cdf8d2d8fe16f71e05afac98dd0808917e362cf5 100644 (file)
@@ -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"))