From 296f92f5c4158162f9cbf2558b52d2cf7cf3178c Mon Sep 17 00:00:00 2001 From: zhouhenglc Date: Wed, 7 Aug 2019 14:30:14 +0800 Subject: [PATCH] remove try_again from _commit_port_binding the parameter try_again is not used in the method. Change-Id: Ibd3fb9286cbf6906eb4a1bc5a43194fbf36f8a60 --- neutron/plugins/ml2/plugin.py | 7 +++---- neutron/tests/unit/plugins/ml2/test_plugin.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 16ba583e4e5..b8911164724 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -517,7 +517,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, # Now, the port and its binding state should be committed. context, need_notify, try_again = ( self._commit_port_binding(context, bind_context, - need_notify, try_again)) + need_notify)) else: context = bind_context @@ -576,8 +576,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, return new_context def _commit_port_binding(self, orig_context, bind_context, - need_notify, try_again, - update_binding_levels=True): + need_notify, update_binding_levels=True): port_id = orig_context.current['id'] plugin_context = orig_context._plugin_context orig_binding = orig_context._binding @@ -2537,7 +2536,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, for count in range(MAX_BIND_TRIES): cur_context, _, try_again = self._commit_port_binding( original_context, bind_context, need_notify=True, - try_again=True, update_binding_levels=False) + update_binding_levels=False) if not try_again: self.notifier.binding_deactivate(context, port_id, active_binding.host, diff --git a/neutron/tests/unit/plugins/ml2/test_plugin.py b/neutron/tests/unit/plugins/ml2/test_plugin.py index 043d61cae8d..ae8329f116c 100644 --- a/neutron/tests/unit/plugins/ml2/test_plugin.py +++ b/neutron/tests/unit/plugins/ml2/test_plugin.py @@ -2322,7 +2322,7 @@ class TestMl2PortBinding(Ml2PluginV2TestCase, mock.patch.object(driver_context.PortContext, '_push_binding_level') as pbl_mock: plugin._commit_port_binding( - port_context, bound_context, True, False) + port_context, bound_context, True) pbl_mock.assert_called_once_with(db_portbinding) def test_port_binding_profile_not_changed(self):