NSXP: port deletion in designate

When a Neutron port is deleted, the DNS entry in Designate should be
deleted as well.
This is done by triggering a BEFORE_DELETE event in delete_port()

Change-Id: I341824b813bed11de2428238a0952626d1edb02e
This commit is contained in:
Kobi Samoray 2021-05-24 11:05:53 +03:00
parent 1598598bee
commit 736ce2e600
1 changed files with 9 additions and 0 deletions

View File

@ -2241,6 +2241,15 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
l3_port_check=True, l2gw_port_check=True, l3_port_check=True, l2gw_port_check=True,
force_delete_dhcp=False, force_delete_dhcp=False,
force_delete_vpn=False): force_delete_vpn=False):
if not force_delete_dhcp:
# Send delete port notification to any interested service plugin
# DHCP ports should not have DNS entries
registry.publish(resources.PORT, events.BEFORE_DELETE, self,
payload=events.DBEventPayload(
context, resource_id=port_id,
metadata={'port_check': l3_port_check}))
# first update neutron (this will perform all types of validations) # first update neutron (this will perform all types of validations)
port_data = self.get_port(context, port_id) port_data = self.get_port(context, port_id)
net_id = port_data['network_id'] net_id = port_data['network_id']