From 2c62e14a0e89cacc865936d0f7f418b172ea07e9 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 1 May 2013 07:04:45 +0000 Subject: [PATCH] Set network_device_mtu as integer Fixes bug 1175060 Change-Id: Ibce28db0575dd6d6f1f998a7b8d6603f3d6dba63 --- quantum/agent/linux/interface.py | 2 +- quantum/tests/unit/test_linux_interface.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/quantum/agent/linux/interface.py b/quantum/agent/linux/interface.py index e7bd103e24..056a2bcce1 100644 --- a/quantum/agent/linux/interface.py +++ b/quantum/agent/linux/interface.py @@ -39,7 +39,7 @@ OPTS = [ cfg.BoolOpt('ovs_use_veth', default=False, help=_('Uses veth for an interface or not')), - cfg.StrOpt('network_device_mtu', + cfg.IntOpt('network_device_mtu', help=_('MTU setting for device.')), cfg.StrOpt('meta_flavor_driver_mappings', help=_('Mapping between flavor and LinuxInterfaceDriver')), diff --git a/quantum/tests/unit/test_linux_interface.py b/quantum/tests/unit/test_linux_interface.py index 9ae8c82c7e..df8b561b90 100644 --- a/quantum/tests/unit/test_linux_interface.py +++ b/quantum/tests/unit/test_linux_interface.py @@ -152,6 +152,11 @@ class TestOVSInterfaceDriver(TestBase): self.ip.assert_has_calls(expected) + def test_mtu_int(self): + self.assertIsNone(self.conf.network_device_mtu) + self.conf.set_override('network_device_mtu', 9000) + self.assertEqual(self.conf.network_device_mtu, 9000) + def test_plug_mtu(self): self.conf.set_override('network_device_mtu', 9000) self._test_plug([mock.call().device().link.set_mtu(9000)])