Merge "Pass host parameter to the get_network_info method"
This commit is contained in:
commit
f434f4a011
@ -167,7 +167,7 @@ class DhcpRpcCallback(object):
|
|||||||
ret = []
|
ret = []
|
||||||
for network in networks:
|
for network in networks:
|
||||||
ret.append(self.get_network_info(
|
ret.append(self.get_network_info(
|
||||||
context, network=network, enable_dhcp=enable_dhcp,
|
context, network=network, enable_dhcp=enable_dhcp, host=host,
|
||||||
ports=grouped_ports.get(network.id, [])))
|
ports=grouped_ports.get(network.id, [])))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
@ -70,9 +70,9 @@ class TestDhcpRpcCallback(base.BaseTestCase):
|
|||||||
{'id': 'port2', 'network_id': 'net2'},
|
{'id': 'port2', 'network_id': 'net2'},
|
||||||
{'id': 'port3', 'network_id': 'net3'}]
|
{'id': 'port3', 'network_id': 'net3'}]
|
||||||
self.plugin.get_ports.return_value = ports
|
self.plugin.get_ports.return_value = ports
|
||||||
iter_kwargs = iter([{'enable_dhcp_filter': True},
|
iter_kwargs = iter([{'enable_dhcp_filter': True, 'host': 'test-host'},
|
||||||
{'enable_dhcp_filter': False},
|
{'enable_dhcp_filter': False, 'host': 'test-host'},
|
||||||
{}])
|
{'host': 'test-host'}])
|
||||||
with mock.patch.object(self.callbacks, '_get_active_networks') as \
|
with mock.patch.object(self.callbacks, '_get_active_networks') as \
|
||||||
mock_get_networks, \
|
mock_get_networks, \
|
||||||
mock.patch.object(self.callbacks, 'get_network_info') as \
|
mock.patch.object(self.callbacks, 'get_network_info') as \
|
||||||
@ -86,11 +86,11 @@ class TestDhcpRpcCallback(base.BaseTestCase):
|
|||||||
None)
|
None)
|
||||||
mock_get_network_info.assert_has_calls([
|
mock_get_network_info.assert_has_calls([
|
||||||
mock.call('ctx', network=networks[0], enable_dhcp=enable_dhcp,
|
mock.call('ctx', network=networks[0], enable_dhcp=enable_dhcp,
|
||||||
ports=[ports[0]]),
|
host='test-host', ports=[ports[0]]),
|
||||||
mock.call('ctx', network=networks[1], enable_dhcp=enable_dhcp,
|
mock.call('ctx', network=networks[1], enable_dhcp=enable_dhcp,
|
||||||
ports=[ports[1]]),
|
host='test-host', ports=[ports[1]]),
|
||||||
mock.call('ctx', network=networks[2], enable_dhcp=enable_dhcp,
|
mock.call('ctx', network=networks[2], enable_dhcp=enable_dhcp,
|
||||||
ports=[ports[2]])
|
host='test-host', ports=[ports[2]])
|
||||||
])
|
])
|
||||||
|
|
||||||
def _test__port_action_with_failures(self, exc=None, action=None):
|
def _test__port_action_with_failures(self, exc=None, action=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user