From 21405378f03d570834adf395c751f69075f128b2 Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Tue, 19 May 2020 13:45:37 +0000 Subject: [PATCH] Fix neutron-ovn-db-sync-util issues Two places needed to pass the _plugin_context like the mech driver already does since PortContext has no session. There was also a place where a port object was passed instead of a port id. Closes-Bug: #1879502 Change-Id: I19ee7b0cf4f8ab187e0a9025eece1ad3525e58e4 --- neutron/cmd/ovn/neutron_ovn_db_sync_util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/neutron/cmd/ovn/neutron_ovn_db_sync_util.py b/neutron/cmd/ovn/neutron_ovn_db_sync_util.py index 556b654bbaa..92bae80ae2a 100644 --- a/neutron/cmd/ovn/neutron_ovn_db_sync_util.py +++ b/neutron/cmd/ovn/neutron_ovn_db_sync_util.py @@ -63,7 +63,7 @@ class OVNMechanismDriver(mech_driver.OVNMechanismDriver): def create_port_postcommit(self, context): port = context.current - self.ovn_client.create_port(context, port) + self.ovn_client.create_port(context._plugin_context, port) def update_port_precommit(self, context): pass @@ -71,7 +71,8 @@ class OVNMechanismDriver(mech_driver.OVNMechanismDriver): def update_port_postcommit(self, context): port = context.current original_port = context.original - self.ovn_client.update_port(context, port, original_port) + self.ovn_client.update_port(context._plugin_context, port, + original_port) def delete_port_precommit(self, context): pass @@ -81,7 +82,7 @@ class OVNMechanismDriver(mech_driver.OVNMechanismDriver): port['network'] = context.network.current # FIXME(lucasagomes): PortContext does not have a session, therefore # we need to use the _plugin_context attribute. - self.ovn_client.delete_port(context._plugin_context, port) + self.ovn_client.delete_port(context._plugin_context, port['id']) class AgentNotifierApi(object):