Deprecate min_l3_agents_per_router option

The min_l3_agents_per_router parameter is deprecated, has no effect
and will be removed for the Ocata release.

You can read the information[1] to learn more.
[1] http://git.openstack.org/cgit/openstack/neutron/tree/neutron/db/l3_hamode_db.py#n65

Change-Id: If5e099d30f2b1269c799f22727a83f8c35979eaf
This commit is contained in:
ZhongShengping 2016-07-12 09:25:01 +08:00
parent d591774c54
commit b45b92466d
3 changed files with 16 additions and 30 deletions

View File

@ -207,10 +207,6 @@
# (optional) Maximum number of l3 agents which a HA router will be scheduled on. If set to '0', a router will be scheduled on every agent.
# Defaults to '3'
#
# [*min_l3_agents_per_router*]
# (optional) Minimum number of l3 agents which a HA router will be scheduled on.
# Defaults to '2'
#
# [*l3_ha_net_cidr*]
# (optional) CIDR of the administrative network if HA mode is enabled.
# Defaults to $::os_service_default
@ -301,6 +297,10 @@
# LBaaS agent should be installed from neutron::agents::lbaas.
# Defaults to false.
#
# [*min_l3_agents_per_router*]
# Deprecated. (optional) Minimum number of l3 agents which a HA router will be scheduled on.
# Defaults to undef
#
class neutron::server (
$package_ensure = 'present',
$enabled = true,
@ -338,7 +338,6 @@ class neutron::server (
$allow_automatic_dhcp_failover = $::os_service_default,
$l3_ha = false,
$max_l3_agents_per_router = 3,
$min_l3_agents_per_router = 2,
$l3_ha_net_cidr = $::os_service_default,
$qos_notification_drivers = $::os_service_default,
$network_auto_schedule = $::os_service_default,
@ -361,6 +360,7 @@ class neutron::server (
$auth_plugin = $::os_service_default,
$tenant_name = $::os_service_default,
$ensure_lbaas_package = false,
$min_l3_agents_per_router = undef,
) inherits ::neutron::params {
include ::neutron::deps
@ -424,23 +424,18 @@ class neutron::server (
})
}
if $min_l3_agents_per_router <= $max_l3_agents_per_router or $max_l3_agents_per_router == 0 {
neutron_config {
'DEFAULT/l3_ha': value => $l3_ha;
'DEFAULT/max_l3_agents_per_router': value => $max_l3_agents_per_router;
'DEFAULT/min_l3_agents_per_router': value => $min_l3_agents_per_router;
'DEFAULT/l3_ha_net_cidr': value => $l3_ha_net_cidr;
}
} else {
fail('min_l3_agents_per_router should be less than or equal to max_l3_agents_per_router.')
}
if $sync_db {
include ::neutron::db::sync
}
if $min_l3_agents_per_router {
warning('min_l3_agents_per_router is deprecated, has no effect and will be removed for the Ocata release.')
}
neutron_config {
'DEFAULT/l3_ha': value => $l3_ha;
'DEFAULT/max_l3_agents_per_router': value => $max_l3_agents_per_router;
'DEFAULT/l3_ha_net_cidr': value => $l3_ha_net_cidr;
'DEFAULT/api_workers': value => $api_workers;
'DEFAULT/rpc_workers': value => $rpc_workers;
'DEFAULT/agent_down_time': value => $agent_down_time;

View File

@ -0,0 +1,4 @@
---
deprecations:
- min_l3_agents_per_router is deprecated, has no effect
and will be removed for the Ocata release.

View File

@ -30,7 +30,6 @@ describe 'neutron::server' do
:router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
:l3_ha => false,
:max_l3_agents_per_router => 3,
:min_l3_agents_per_router => 2,
}
end
@ -126,7 +125,6 @@ describe 'neutron::server' do
it 'should enable HA routers' do
is_expected.to contain_neutron_config('DEFAULT/l3_ha').with_value(true)
is_expected.to contain_neutron_config('DEFAULT/max_l3_agents_per_router').with_value(3)
is_expected.to contain_neutron_config('DEFAULT/min_l3_agents_per_router').with_value(2)
is_expected.to contain_neutron_config('DEFAULT/l3_ha_net_cidr').with_value('<SERVICE DEFAULT>')
end
end
@ -138,7 +136,6 @@ describe 'neutron::server' do
it 'should disable HA routers' do
is_expected.to contain_neutron_config('DEFAULT/l3_ha').with_value(false)
is_expected.to contain_neutron_config('DEFAULT/max_l3_agents_per_router').with_value(3)
is_expected.to contain_neutron_config('DEFAULT/min_l3_agents_per_router').with_value(2)
is_expected.to contain_neutron_config('DEFAULT/l3_ha_net_cidr').with_value('<SERVICE DEFAULT>')
end
end
@ -153,16 +150,6 @@ describe 'neutron::server' do
end
end
context 'with HA routers enabled and wrong parameters' do
before :each do
params.merge!(:l3_ha => true,
:max_l3_agents_per_router => 2,
:min_l3_agents_per_router => 3 )
end
it_raises 'a Puppet::Error', /min_l3_agents_per_router should be less than or equal to max_l3_agents_per_router./
end
context 'with custom service name' do
before :each do
params.merge!(:service_name => 'custom-service-name')