Use global_physnet_mtu to fix MTU settings in Mitaka

[DEFAULT]/network_device_mtu option is deprecated and will be removed
in Newton. However, new [ml2]/segment_mtu is deprecated too according to
neutron/common/config.py. This patch replaces network_device_mtu with
new [DEFAULT]/global_physnet_mtu.

Change-Id: I9eb5df274e5d7f1f89c5f894526d07d20d4cd794
Closes-bug: #1565036
This commit is contained in:
Vladimir Eremin 2016-04-01 21:11:49 +03:00
parent 98dce78cd7
commit d301833c2c
3 changed files with 30 additions and 6 deletions

View File

@ -71,7 +71,7 @@
# This enables redundant DHCP agents for configured networks.
# Defaults to $::os_service_default
#
# [*network_device_mtu*]
# [*global_physnet_mtu*]
# (optional) The MTU size for the interfaces managed by neutron
# Defaults to $::os_service_default
#
@ -263,6 +263,7 @@
# [*qpid_reconnect_interval*]
# [*qpid_reconnect_interval_min*]
# [*qpid_reconnect_interval_max*]
# [*network_device_mtu*]
#
class neutron (
$enabled = true,
@ -279,7 +280,7 @@ class neutron (
$dhcp_lease_duration = $::os_service_default,
$dns_domain = $::os_service_default,
$dhcp_agents_per_network = $::os_service_default,
$network_device_mtu = $::os_service_default,
$global_physnet_mtu = $::os_service_default,
$dhcp_agent_notification = $::os_service_default,
$advertise_mtu = $::os_service_default,
$allow_bulk = $::os_service_default,
@ -334,6 +335,7 @@ class neutron (
$qpid_reconnect_interval_min = undef,
$qpid_reconnect_interval_max = undef,
$qpid_reconnect_interval = undef,
$network_device_mtu = undef,
) {
include ::neutron::params
@ -407,7 +409,7 @@ class neutron (
'DEFAULT/api_extensions_path': value => $api_extensions_path;
'DEFAULT/state_path': value => $state_path;
'DEFAULT/rpc_response_timeout': value => $rpc_response_timeout;
'DEFAULT/network_device_mtu': value => $network_device_mtu;
'DEFAULT/global_physnet_mtu': value => pick($network_device_mtu, $global_physnet_mtu);
'oslo_concurrency/lock_path': value => $lock_path;
'agent/root_helper': value => $root_helper;
'agent/report_interval': value => $report_interval;
@ -507,6 +509,10 @@ class neutron (
warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
}
if $network_device_mtu {
warning('The neutron::network_device_mtu parameter is deprecated, use neutron::global_physnet_mtu instead.')
}
# SSL Options
neutron_config {
'DEFAULT/use_ssl': value => $use_ssl;

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
[DEFAULT]/network_device_mtu option is deprecated and will be removed
in Newton. However, new [ml2]/segment_mtu is deprecated too according to
neutron/common/config.py. New [DEFAULT]/global_physnet_mtu should be used.

View File

@ -122,7 +122,7 @@ describe 'neutron' do
is_expected.to contain_neutron_config('DEFAULT/dhcp_lease_duration').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/dns_domain').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/dhcp_agents_per_network').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/network_device_mtu').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/global_physnet_mtu').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/dhcp_agent_notification').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/advertise_mtu').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/allow_bulk').with_value('<SERVICE DEFAULT>')
@ -441,7 +441,19 @@ describe 'neutron' do
end
shared_examples_for 'with network_device_mtu defined' do
shared_examples_for 'with global_physnet_mtu defined' do
before do
params.merge!(
:global_physnet_mtu => 9000
)
end
it do
is_expected.to contain_neutron_config('DEFAULT/global_physnet_mtu').with_value(params[:global_physnet_mtu])
end
end
shared_examples_for 'with deprecated network_device_mtu defined' do
before do
params.merge!(
:network_device_mtu => 9000
@ -449,7 +461,7 @@ describe 'neutron' do
end
it do
is_expected.to contain_neutron_config('DEFAULT/network_device_mtu').with_value(params[:network_device_mtu])
is_expected.to contain_neutron_config('DEFAULT/global_physnet_mtu').with_value(params[:network_device_mtu])
end
end