From 6fc20a69618366cebaf1bbb3a7d61548f2bd29c7 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Wed, 18 Dec 2019 15:08:43 +0200 Subject: [PATCH] NSX|P: be more careful when deleting a network Verify value in cache before removing it Change-Id: If3fbfe0be4cc0c2fe1890eb5f78df2236e275633 --- vmware_nsx/plugins/nsx_p/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index 70cb60b6f4..8e5aacab72 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -837,7 +837,8 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): if network_id in NET_NEUTRON_2_NSX_ID_CACHE: nsx_id = NET_NEUTRON_2_NSX_ID_CACHE[network_id] del NET_NEUTRON_2_NSX_ID_CACHE[network_id] - del NET_NSX_2_NEUTRON_ID_CACHE[nsx_id] + if nsx_id in NET_NSX_2_NEUTRON_ID_CACHE: + del NET_NSX_2_NEUTRON_ID_CACHE[nsx_id] def update_network(self, context, network_id, network): original_net = super(NsxPolicyPlugin, self).get_network(