remove try_again from _commit_port_binding

the parameter try_again is not used in the method.

Change-Id: Ibd3fb9286cbf6906eb4a1bc5a43194fbf36f8a60
This commit is contained in:
zhouhenglc 2019-08-07 14:30:14 +08:00
parent 866ccff1c1
commit 296f92f5c4
2 changed files with 4 additions and 5 deletions

View File

@ -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,

View File

@ -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):