]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Query for port before calling l3plugin.disassociate_floatingips()
authorAaron Rosen <aaronorosen@gmail.com>
Wed, 5 Mar 2014 19:32:39 +0000 (11:32 -0800)
committerAaron Rosen <aaronorosen@gmail.com>
Wed, 12 Mar 2014 00:10:37 +0000 (17:10 -0700)
The call to l3plugin.disassociate_floatingips() trigggers several events
that could cause a timeout to occur trying to query the db for the port
therefore this patch changes the code to query first for the port.

Closes-bug: #1290478

Change-Id: I69fe9cff4b550240215329e1082a63cd11617faa

neutron/plugins/ml2/plugin.py

index 2dab2db88bf2e6d6aaeaca89d8b0ac705077a546..c7bca04e2a463c565f43884e1c079277412a9b2b 100644 (file)
@@ -701,8 +701,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
 
         session = context.session
         with session.begin(subtransactions=True):
-            if l3plugin:
-                l3plugin.disassociate_floatingips(context, id)
             try:
                 port_db = (session.query(models_v2.Port).
                            enable_eagerloads(False).
@@ -721,6 +719,9 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
             self._delete_port_binding(mech_context)
             self._delete_port_security_group_bindings(context, id)
             LOG.debug(_("Calling base delete_port"))
+            if l3plugin:
+                l3plugin.disassociate_floatingips(context, id)
+
             super(Ml2Plugin, self).delete_port(context, id)
 
         try: