Merge "Fix generation of thousands of DHCP tap interfaces"

This commit is contained in:
Jenkins 2017-09-09 03:03:55 +00:00 committed by Gerrit Code Review
commit 75d98fcd79
2 changed files with 4 additions and 0 deletions

View File

@ -1432,6 +1432,8 @@ class DeviceManager(object):
LOG.exception('Unable to plug DHCP port for ' LOG.exception('Unable to plug DHCP port for '
'network %s. Releasing port.', 'network %s. Releasing port.',
network.id) network.id)
# We should unplug the interface in bridge side.
self.unplug(interface_name, network)
self.plugin.release_dhcp_port(network.id, port.device_id) self.plugin.release_dhcp_port(network.id, port.device_id)
self.fill_dhcp_udp_checksums(namespace=network.namespace) self.fill_dhcp_udp_checksums(namespace=network.namespace)

View File

@ -1571,6 +1571,8 @@ class TestDeviceManager(base.BaseTestCase):
dh.driver.plug.side_effect = OSError() dh.driver.plug.side_effect = OSError()
net = copy.deepcopy(fake_network) net = copy.deepcopy(fake_network)
self.assertRaises(OSError, dh.setup, net) self.assertRaises(OSError, dh.setup, net)
dh.driver.unplug.assert_called_once_with(mock.ANY,
namespace=net.namespace)
plugin.release_dhcp_port.assert_called_once_with( plugin.release_dhcp_port.assert_called_once_with(
net.id, mock.ANY) net.id, mock.ANY)