Remove deprecated configuration option network_device_mtu

UpgradeImpact: The network_device_mtu option in Nova is deprecated
for removal in 13.0.0 since network MTU should be specified when
creating the network.

Change-Id: I2fc98cbd5845f59a886899d0ecea68a6634a8d18
This commit is contained in:
ChangBo Guo(gcb) 2016-05-21 16:10:12 +08:00 committed by ChangBo Guo(gcb)
parent 2bd800ce25
commit 14da85ac95
6 changed files with 5 additions and 72 deletions

View File

@ -381,20 +381,6 @@ The use of this configuration has been deprecated and may be removed in any
release after Mitaka. It is recommended that instead of relying on this option,
an explicit value should be passed to 'create_networks()' as a keyword argument
with the name 'share_address'.
"""),
# NOTE(mriedem): Remove network_device_mtu in Newton.
cfg.IntOpt("network_device_mtu",
deprecated_for_removal=True,
help="""
THIS VALUE SHOULD BE SET WHEN CREATING THE NETWORK.
MTU (Maximum Transmission Unit) setting for a network interface.
The use of this configuration has been deprecated and may be removed in any
release after Mitaka. It is recommended that instead of relying on this option,
an explicit value should be passed to 'create_networks()' as a keyword argument
with the name 'mtu'.
"""),
cfg.BoolOpt('use_neutron',
default=False,

View File

@ -1231,9 +1231,6 @@ def _ip_bridge_cmd(action, params, device):
def _set_device_mtu(dev, mtu=None):
"""Set the device MTU."""
if not mtu:
mtu = CONF.network_device_mtu
if mtu:
utils.execute('ip', 'link', 'set', dev, 'mtu',
mtu, run_as_root=True,

View File

@ -1111,8 +1111,6 @@ class NetworkManager(manager.Manager):
bridge_interface=None, dns1=None, dns2=None,
fixed_cidr=None, allowed_start=None,
allowed_end=None, **kwargs):
if 'mtu' not in kwargs:
kwargs['mtu'] = CONF.network_device_mtu
if 'dhcp_server' not in kwargs:
kwargs['dhcp_server'] = gateway
if 'enable_dhcp' not in kwargs:

View File

@ -105,8 +105,6 @@ class Network(obj_base.NovaPersistentObject, obj_base.NovaObject,
db_value = db_network[field]
if field is 'netmask_v6' and db_value is not None:
db_value = network._convert_legacy_ipv6_netmask(db_value)
if field is 'mtu' and db_value is None:
db_value = CONF.network_device_mtu
if field is 'dhcp_server' and db_value is None:
db_value = db_network['gateway']
if field is 'share_address' and CONF.share_dhcp_address:

View File

@ -1199,17 +1199,6 @@ class LinuxNetworkTestCase(test.NoDBTestCase):
driver.ensure_bridge('brq1234567-89', '')
device_exists.assert_called_once_with('brq1234567-89')
def test_set_device_mtu_configured(self):
self.flags(network_device_mtu=10000)
calls = [
mock.call('ip', 'link', 'set', 'fake-dev', 'mtu',
10000, run_as_root=True,
check_exit_code=[0, 2, 254])
]
with mock.patch.object(utils, 'execute', return_value=('', '')) as ex:
linux_net._set_device_mtu('fake-dev')
ex.assert_has_calls(calls)
def test_set_device_mtu_default(self):
calls = []
with mock.patch.object(utils, 'execute', return_value=('', '')) as ex:
@ -1277,24 +1266,6 @@ class LinuxNetworkTestCase(test.NoDBTestCase):
self.assertFalse(mock_set_device_mtu.called)
self.assertTrue(mock_vsctl.called)
def test_ovs_vif_port_with_mtu(self):
self.flags(network_device_mtu=10000)
calls = [
mock.call('ovs-vsctl', '--timeout=120', '--', '--if-exists',
'del-port', 'fake-dev', '--', 'add-port',
'fake-bridge', 'fake-dev',
'--', 'set', 'Interface', 'fake-dev',
'external-ids:iface-id=fake-iface-id',
'external-ids:iface-status=active',
'external-ids:attached-mac=fake-mac',
'external-ids:vm-uuid=fake-instance-uuid',
run_as_root=True),
mock.call('ip', 'link', 'set', 'fake-dev', 'mtu',
10000, run_as_root=True,
check_exit_code=[0, 2, 254])
]
self._ovs_vif_port(calls)
def _create_veth_pair(self, calls):
with mock.patch.object(utils, 'execute', return_value=('', '')) as ex:
linux_net._create_veth_pair('fake-dev1', 'fake-dev2')
@ -1315,28 +1286,6 @@ class LinuxNetworkTestCase(test.NoDBTestCase):
]
self._create_veth_pair(calls)
def test_create_veth_pair_with_mtu(self):
self.flags(network_device_mtu=10000)
calls = [
mock.call('ip', 'link', 'add', 'fake-dev1', 'type', 'veth',
'peer', 'name', 'fake-dev2', run_as_root=True),
mock.call('ip', 'link', 'set', 'fake-dev1', 'up',
run_as_root=True),
mock.call('ip', 'link', 'set', 'fake-dev1', 'promisc', 'on',
run_as_root=True),
mock.call('ip', 'link', 'set', 'fake-dev1', 'mtu',
10000, run_as_root=True,
check_exit_code=[0, 2, 254]),
mock.call('ip', 'link', 'set', 'fake-dev2', 'up',
run_as_root=True),
mock.call('ip', 'link', 'set', 'fake-dev2', 'promisc', 'on',
run_as_root=True),
mock.call('ip', 'link', 'set', 'fake-dev2', 'mtu',
10000, run_as_root=True,
check_exit_code=[0, 2, 254])
]
self._create_veth_pair(calls)
def test_exec_ebtables_success(self):
executes = []

View File

@ -0,0 +1,5 @@
---
upgrade:
- The network_device_mtu option in Nova is deprecated for removal
in 13.0.0 since network MTU should be specified when creating
the network.