From: Aaron Rosen Date: Wed, 5 Mar 2014 19:32:39 +0000 (-0800) Subject: Query for port before calling l3plugin.disassociate_floatingips() X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=665352f169a7d1e7eca590d466241cc313adb7c3;p=openstack-build%2Fneutron-build.git Query for port before calling l3plugin.disassociate_floatingips() 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 --- diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 2dab2db88..c7bca04e2 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -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: