Skip to content

Commit 182b5ac

Browse files
committed
Add the port "fixed_ips" information in the DHCP RPC
In [1], a method to process the DHCP events in the correct order was implemented. That method checks the port events in order to match the "fixed_ips" field. That implies the Neutron server provides this information in the port event, sent via RPC. However in [2], the "fixed_ips" information was removed from the ``DhcpAgentNotifyAPI._after_router_interface_deleted``, causing a periodic error in the ``DHCPResourceUpdate.__lt__`` method, as reported in the LP bug. This patch is restoring this field in the RPC message. [1]https://review.opendev.org/c/openstack/neutron/+/773160 [2]https://review.opendev.org/c/openstack/neutron/+/639814 Closes-Bug: #2071426 Change-Id: If1362b9b91794e74e8cf6bb233e661fba9fb3b26 (cherry picked from commit b0081ac)
1 parent 9de68a7 commit 182b5ac

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ def _after_router_interface_deleted(self, resource, event, trigger,
284284
port = payload.metadata.get('port')
285285
self._notify_agents(payload.context, 'port_delete_end',
286286
{'port_id': port['id'],
287+
'fixed_ips': port['fixed_ips'],
287288
'network_id': port['network_id']},
288289
port['network_id'])
289290

neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def test__notify_agents_with_router_interface_delete(self):
251251
payload = events.DBEventPayload(
252252
mock.Mock(), metadata={
253253
'port': {'id': 'foo_port_id',
254+
'fixed_ips': mock.ANY,
254255
'network_id': 'foo_network_id'}})
255256
self._test__notify_agents_with_function(
256257
lambda: self.notifier._after_router_interface_deleted(

0 commit comments

Comments
 (0)