From 1c846b4304f3fce21755f6a415774013d6619784 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 19 Aug 2015 12:21:36 -0700 Subject: [PATCH] NSXv: do not fail on spoofgaurd policy error The VM is deleted from VC and then this call is made. In this case, VC must be sending the VM & vnic delete update first to NSX manager and the plugin is sending the delete call later to NSX manager. This error can be ignored for now, unless we make sure VM is deleted only after neutron plugin deletes the port. Change-Id: I2e69466e76b3b7339c6854e5c04f1309ede19f56 Closes-bug: #1486722 (cherry picked from commit 636f809f301fb17709ce10bbc198df9828d1ca51) --- vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py index 49b9f3ce44..3b5d8878a0 100644 --- a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py +++ b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py @@ -973,8 +973,13 @@ class NsxVPluginV2(agents_db.AgentDbMixin, context.session, vnic_id, sgids) if (cfg.CONF.nsxv.spoofguard_enabled and neutron_db_port[psec.PORTSECURITY]): - self._remove_vnic_from_spoofguard_policy( - context.session, neutron_db_port['network_id'], vnic_id) + try: + self._remove_vnic_from_spoofguard_policy( + context.session, neutron_db_port['network_id'], + vnic_id) + except Exception as e: + LOG.error(_LE('Could not delete the spoofguard policy. ' + 'Exception %s'), e) self.disassociate_floatingips(context, id) with context.session.begin(subtransactions=True):