Fix passing error physical network for get_mtu
The network's physical network should be used to get the network's mtu. Change-Id: Ib68cf7a64332c6a4b3df7b5d0a41922421b58dba Closes-bug: #1617284
This commit is contained in:
parent
665fd24623
commit
0d96b9b43c
|
@ -713,7 +713,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
|
|||
}
|
||||
)
|
||||
else:
|
||||
mtu = type_driver.get_mtu(provider.PHYSICAL_NETWORK)
|
||||
mtu = type_driver.get_mtu(s[provider.PHYSICAL_NETWORK])
|
||||
# Some drivers, like 'local', may return None; the assumption
|
||||
# then is that for the segment type, MTU has no meaning or
|
||||
# unlimited, and so we should then ignore those values.
|
||||
|
|
|
@ -1161,6 +1161,19 @@ class TestMl2PluginOnly(Ml2PluginV2TestCase):
|
|||
|
||||
class Test_GetNetworkMtu(Ml2PluginV2TestCase):
|
||||
|
||||
def test_get_mtu_with_physical_net(self):
|
||||
plugin = manager.NeutronManager.get_plugin()
|
||||
mock_type_driver = mock.MagicMock()
|
||||
plugin.type_manager.drivers['driver1'] = mock.Mock()
|
||||
plugin.type_manager.drivers['driver1'].obj = mock_type_driver
|
||||
net = {
|
||||
'name': 'net1',
|
||||
pnet.NETWORK_TYPE: 'driver1',
|
||||
pnet.PHYSICAL_NETWORK: 'physnet1',
|
||||
}
|
||||
plugin._get_network_mtu(net)
|
||||
mock_type_driver.get_mtu.assert_called_once_with('physnet1')
|
||||
|
||||
def _register_type_driver_with_mtu(self, driver, mtu):
|
||||
plugin = manager.NeutronManager.get_plugin()
|
||||
|
||||
|
|
Loading…
Reference in New Issue