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 636f809f30)
This commit is contained in:
Gary Kotton 2015-08-19 12:21:36 -07:00 committed by garyk
parent 8fce2bc969
commit 1c846b4304
1 changed files with 7 additions and 2 deletions

View File

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