]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix order of calls in update_port
authorSam Betts <sam@code-smash.net>
Thu, 16 Jul 2015 13:08:59 +0000 (14:08 +0100)
committerSam Betts <sam@code-smash.net>
Fri, 31 Jul 2015 13:53:22 +0000 (14:53 +0100)
https://review.openstack.org/#/c/196908 introduced some extra logic to
do with DVR to update_port, however it changed the ordering of some of
the calls, this patch ensures that the calls that need to happen before
precommit happen in the right place.

Change-Id: I560100b3be76c616a93bf7d3264675dce6cef732
Closes-Bug: #1475297

neutron/plugins/ml2/plugin.py

index 9a1d5a84eac014e55da23f4fd7474f0691f0034f..e787ff9de7e81add2d44ae661add057955a7f741 100644 (file)
@@ -1125,6 +1125,10 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
             mech_context = driver_context.PortContext(
                 self, context, updated_port, network, binding, levels,
                 original_port=original_port)
+            new_host_port = self._get_host_port_if_changed(
+                mech_context, attrs)
+            need_port_update_notify |= self._process_port_binding(
+                mech_context, attrs)
             # For DVR router interface ports we need to retrieve the
             # DVRPortbinding context instead of the normal port context.
             # The normal Portbinding context does not have the status
@@ -1151,10 +1155,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
                 self.mechanism_manager.update_port_precommit(mech_context)
                 bound_mech_contexts.append(mech_context)
 
-            new_host_port = self._get_host_port_if_changed(
-                mech_context, attrs)
-            need_port_update_notify |= self._process_port_binding(
-                mech_context, attrs)
         # Notifications must be sent after the above transaction is complete
         kwargs = {
             'context': context,