From f6ffac2537870956efabe56326c3b30b2ecbf336 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 16 Jul 2015 14:08:59 +0100 Subject: [PATCH] Fix order of calls in update_port 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 9a1d5a84e..e787ff9de 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -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, -- 2.45.2