From b8c0376e8e0623a36f172722d4f0ae44a66b5519 Mon Sep 17 00:00:00 2001 From: Moshe Levi Date: Tue, 24 Jan 2017 11:40:26 +0200 Subject: [PATCH] check port device_owner before sending DELETE port Change-Id: If6c7ea366c774e90fdddbaaa6dd2b1bd6854a84c --- networking_mlnx/plugins/ml2/drivers/sdn/sdn_mech_driver.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/networking_mlnx/plugins/ml2/drivers/sdn/sdn_mech_driver.py b/networking_mlnx/plugins/ml2/drivers/sdn/sdn_mech_driver.py index 89dea52..d2b89f2 100644 --- a/networking_mlnx/plugins/ml2/drivers/sdn/sdn_mech_driver.py +++ b/networking_mlnx/plugins/ml2/drivers/sdn/sdn_mech_driver.py @@ -193,13 +193,15 @@ class SDNMechanismDriver(api.MechanismDriver): # delete the port in case instance is deleted # and port is created separately elif (orig_port_dict[portbindings.HOST_ID] and - not port_dic[portbindings.HOST_ID]): + not port_dic[portbindings.HOST_ID] and + self._is_send_bind_port(orig_port_dict)): SDNMechanismDriver._record_in_journal( context, sdn_const.PORT, sdn_const.DELETE, orig_port_dict) # delete the port in case instance is migrated to another hypervisor elif (orig_port_dict[portbindings.HOST_ID] and port_dic[portbindings.HOST_ID] != - orig_port_dict[portbindings.HOST_ID]): + orig_port_dict[portbindings.HOST_ID] and + self._is_send_bind_port(orig_port_dict)): SDNMechanismDriver._record_in_journal( context, sdn_const.PORT, sdn_const.DELETE, orig_port_dict) else: