Merge "[DHCP agent] Fetch OVN Metadata port from plugin" into stable/wallaby
This commit is contained in:
commit
56b8db138c
@ -1136,7 +1136,8 @@ class Dnsmasq(DhcpLocalProcess):
|
||||
m_ports = [port for port in self.network.ports if
|
||||
self._is_ovn_metadata_port(port, self.network.id)]
|
||||
if m_ports:
|
||||
for fixed_ip in m_ports[0].fixed_ips:
|
||||
port = self.device_manager.plugin.get_dhcp_port(m_ports[0].id)
|
||||
for fixed_ip in port.fixed_ips:
|
||||
if fixed_ip.subnet_id == subnet.id:
|
||||
return fixed_ip.ip_address
|
||||
|
||||
|
@ -3124,6 +3124,8 @@ class TestDnsmasq(TestBase):
|
||||
def test__generate_opts_per_subnet_with_metadata_port(self):
|
||||
config = {'enable_isolated_metadata': False,
|
||||
'force_metadata': False}
|
||||
self.mock_mgr.return_value.plugin.get_dhcp_port.return_value = \
|
||||
FakeOvnMetadataPort()
|
||||
self._test__generate_opts_per_subnet_helper(config, True,
|
||||
network_class=FakeNetworkDhcpandOvnMetadataPort)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user