NSX|V: fix for existing spoofguard policy

Ensure that the policy is published.

Change-Id: Iba2ecd86e88ee4523b1af30554c6318b345059bc
This commit is contained in:
Gary Kotton 2018-03-15 20:48:16 +02:00
parent 8b06741ad7
commit 0356a7909c

View File

@ -4530,10 +4530,15 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
try:
self.nsx_v.vcns.approve_assigned_addresses(
sg_policy_id, vnic_id, mac_addr, approved_addrs)
self.nsx_v.vcns.publish_assigned_addresses(sg_policy_id, vnic_id)
except vsh_exc.AlreadyExists:
# Entry already configured on the NSX
pass
try:
self.nsx_v.vcns.publish_assigned_addresses(sg_policy_id, vnic_id)
except Exception as e:
LOG.warning("Failed to publish entry for port %(port)s "
"for vnic %(vnic)s: %(exc)s",
{'port': port['id'], 'vnic': vnic_id, 'exc': str(e)})
def _is_compute_port(self, port):
try: