Remove several deprecated configuration items in Ocata

Remove several configuration items that were deprecated in newton (and
perhaps earlier):
    - logging_facility
    - advertise_mtu
    - allow_pagination
    - allow_sorting
    - nova_url
    - quota_items
    - prevent_arp_spoofing
    - nova_admin_auth_url
    - nova_admin_username
    - nova_admin_tenant_name
    - nova_admin_tenant_id
    - nova_admin_password
    - nova_region_name

Depends-On: Iff15f85358c512f991612ee204f0f71fe8579335
Change-Id: I9ceba371a62615faebc5e853eefd3db3bd821480
This commit is contained in:
Brent Eagles 2017-01-19 13:16:29 -03:30
parent 27f2987fa5
commit 6a90c23342
9 changed files with 38 additions and 276 deletions

View File

@ -18,8 +18,8 @@ class { '::neutron::server':
# Configure nova notifications system
class { '::neutron::server::notifications':
nova_admin_tenant_name => 'admin',
nova_admin_password => 'secrete',
tenant_name => 'admin',
password => 'secrete',
}
# Various agents

View File

@ -147,10 +147,6 @@
#
# === Deprecated Parameters
#
# [*prevent_arp_spoofing*]
# (optional) Enable or not ARP Spoofing Protection
# Defaults to $::os_service_default
#
# [*enable_tunneling*]
# (optional) Enable or not tunneling
# Defaults to false
@ -184,7 +180,6 @@ class neutron::agents::ml2::ovs (
$enable_dpdk = false,
$minimize_polling = $::os_service_default,
# DEPRECATED PARAMETERS
$prevent_arp_spoofing = $::os_service_default,
$enable_tunneling = false,
) {
@ -240,10 +235,6 @@ class neutron::agents::ml2::ovs (
fail('A value of $ovsdb_interface is incorrect. The allowed values are vsctl and native')
}
if ! is_service_default ($prevent_arp_spoofing) {
warning('The prevent_arp_spoofing parameter is deprecated and will be removed in Ocata release')
}
resources { 'neutron_agent_ovs':
purge => $purge_config,
}
@ -283,7 +274,6 @@ class neutron::agents::ml2::ovs (
'agent/arp_responder': value => $arp_responder;
'agent/enable_distributed_routing': value => $enable_distributed_routing;
'agent/drop_flows_on_start': value => $drop_flows_on_start;
'agent/prevent_arp_spoofing': value => $prevent_arp_spoofing;
'agent/extensions': value => join(any2array($extensions), ',');
'agent/minimize_polling': value => $minimize_polling;
'ovs/integration_bridge': value => $integration_bridge;

View File

@ -335,22 +335,6 @@
#
# DEPRECATED PARAMETERS
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines
# Defaults to undef
#
# [*advertise_mtu*]
# (optional) VMs will receive DHCP and RA MTU option when the network's preferred MTU is known
# Defaults to undef
#
# [*allow_sorting*]
# (optional) Enable sorting
# Defaults to undef
#
# [*allow_pagination*]
# (optional) Enable pagination
# Defaults to undef
#
# [*memcache_servers*]
# (optional) This option is deprecated an has no effect.
#
@ -447,10 +431,6 @@ class neutron (
$notification_topics = $::os_service_default,
$notification_transport_url = $::os_service_default,
# DEPRECATED PARAMETERS
$log_facility = undef,
$advertise_mtu = undef,
$allow_pagination = undef,
$allow_sorting = undef,
$memcache_servers = undef,
$mac_generation_retries = $::os_service_default,
$rabbit_password = $::os_service_default,
@ -491,22 +471,6 @@ class neutron (
warning('kombu_missing_consumer_retry_timeout should not be longer than rpc_response_timeout')
}
if $log_facility {
warning('log_facility is deprecated, has no effect and will be removed after Newton cycle.')
}
if $advertise_mtu {
warning('advertise_mtu is deprecated, has no effect and will be removed in Ocata.')
}
if $allow_sorting {
warning('allow_sorting is deprecated, has no effect and will be removed in a future release.')
}
if $allow_pagination {
warning('allow_pagination is deprecated, has no effect and will be removed in a future release.')
}
if $memcache_servers {
warning('memcache_servers option is deprecated, has no effect and will be removed after Ocata.')
}

View File

@ -97,12 +97,6 @@
# (Optional) Enables or disables fatal status of deprecations (boolean value).
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines
# Defaults to undef
#
class neutron::logging (
$debug = $::os_service_default,
$use_syslog = $::os_service_default,
@ -123,8 +117,6 @@ class neutron::logging (
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$fatal_deprecations = $::os_service_default,
# Deprecated
$log_facility = undef,
) {
include ::neutron::deps
@ -135,10 +127,6 @@ class neutron::logging (
$log_file_real = pick($::neutron::log_file,$log_file)
$log_dir_real = pick($::neutron::log_dir,$log_dir)
if $log_facility {
warning('log_facility is deprecated, has no effect and will be removed after Newton cycle. Please use syslog_log_facility instead.')
}
oslo::log { 'neutron_config':
debug => $debug_real,
use_stderr => $use_stderr_real,

View File

@ -82,12 +82,6 @@
# A negative value means unlimited.
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMATERS
#
# [*quota_items*]
# (optional) Resource name(s) that are supported in quota features.
# Defaults to undef
#
class neutron::quota (
$default_quota = $::os_service_default,
$quota_network = $::os_service_default,
@ -109,16 +103,10 @@ class neutron::quota (
$quota_packet_filter = 100,
$quota_pool = $::os_service_default,
$quota_vip = $::os_service_default,
#DEPRECATED PAMAMETERS
$quota_items = undef,
) {
include ::neutron::deps
if $quota_items {
warning('quota_items is deprecated, has no effect and will be removed after Newton cycle.')
}
neutron_config {
'quotas/default_quota': value => $default_quota;
'quotas/quota_network': value => $quota_network;

View File

@ -16,6 +16,9 @@
#
# === Parameters
#
# [*password*]
# (required) Password for connection to nova in admin context.
#
# [*notify_nova_on_port_status_changes*]
# (optional) Send notification to nova when port status is active.
# Defaults to true
@ -39,10 +42,6 @@
# (optional) Username for connection to nova in admin context
# Defaults to 'nova'
#
# [*password*]
# Password for connection to nova in admin context.
# Either password or nova_admin_password is required
#
# [*tenant_id*]
# (optional) The UUID of the admin nova tenant. If provided this takes
# precedence over tenant_name.
@ -76,55 +75,19 @@
#
# === Deprecated Parameters
#
# [*nova_admin_auth_url*]
# Deprecated. Auth plugins based authentication should be used instead
# Authorization URL for connection to nova in admin context.
# Defaults to 'http://127.0.0.1:35357/v2.0'
#
# [*nova_admin_username*]
# Deprecated. Auth plugins based authentication should be used instead
# (optional) Username for connection to nova in admin context
# Defaults to 'nova'
#
# [*nova_admin_tenant_name*]
# Deprecated. Auth plugins based authentication should be used instead
# The name of the admin nova tenant
# Defaults to 'services'
#
# [*nova_admin_tenant_id*]
# Deprecated. Auth plugins based authentication should be used instead
# The UUID of the admin nova tenant. If provided this takes precedence
# over nova_admin_tenant_name.
#
# [*nova_admin_password*]
# Deprecated. Auth plugins based authentication should be used instead
# Password for connection to nova in admin context.
# Either nova_admin_password or password is required
#
# [*nova_region_name*]
# Deprecated. region_name parameter should be used instead
# Name of nova region to use. Useful if keystone manages more than
# one region.
# Defaults to $::os_service_default
#
# [*auth_plugin*]
# Deprecated. auth_type should be used instead
# An authentication plugin to use with an OpenStack Identity server.
# Defaults to $::os_service_default
#
# [*nova_url*]
# Deprecated URL for connection to nova (Only supports one nova region
# currently).
# Defaults to $::os_service_default
#
class neutron::server::notifications (
$password,
$notify_nova_on_port_status_changes = true,
$notify_nova_on_port_data_changes = true,
$send_events_interval = $::os_service_default,
$auth_type = 'password',
$username = 'nova',
$password = false,
$tenant_id = $::os_service_default,
$tenant_name = 'services',
$project_domain_id = 'default',
@ -133,14 +96,7 @@ class neutron::server::notifications (
$auth_url = 'http://127.0.0.1:35357',
$region_name = $::os_service_default,
# DEPRECATED PARAMETERS
$nova_admin_auth_url = 'http://127.0.0.1:35357/v2.0',
$nova_admin_username = 'nova',
$nova_admin_tenant_name = 'services',
$nova_admin_tenant_id = $::os_service_default,
$nova_admin_password = false,
$nova_region_name = $::os_service_default,
$auth_plugin = $::os_service_default,
$nova_url = $::os_service_default,
) {
include ::neutron::deps
@ -148,74 +104,38 @@ class neutron::server::notifications (
# Depend on the specified keystone_user resource, if it exists.
Keystone_user <| title == 'nova' |> -> Class[neutron::server::notifications]
if ! $nova_admin_password and ! $password {
fail('nova_admin_password or password must be set.')
}
if $nova_admin_password and is_service_default($nova_admin_tenant_id) and (! $nova_admin_tenant_name) {
fail('You must provide either nova_admin_tenant_name or nova_admin_tenant_id.')
}
if $password and is_service_default($tenant_id) and (! $tenant_name) {
if is_service_default($tenant_id) and (! $tenant_name) {
fail('You must provide either tenant_name or tenant_id.')
}
if ! is_service_default ($nova_url) {
warning('nova_url is deprecated and will be removed after Newton cycle.')
neutron_config {
'nova/auth_url': value => $auth_url;
'nova/username': value => $username;
'nova/password': value => $password, secret => true;
'nova/project_domain_id': value => $project_domain_id;
'nova/project_name': value => $project_name;
'nova/user_domain_id': value => $user_domain_id;
'nova/region_name': value => $region_name;
}
if $nova_admin_password {
warning('nova_admin-* and nova_region_name parameters are deprecated and will be removed in a future release')
if ! is_service_default ($auth_plugin) and ($auth_plugin) {
warning('auth_plugin parameter is deprecated, auth_type should be used instead')
neutron_config {
'DEFAULT/nova_admin_auth_url': value => $nova_admin_auth_url;
'DEFAULT/nova_admin_username': value => $nova_admin_username;
'DEFAULT/nova_admin_password': value => $nova_admin_password, secret => true;
'DEFAULT/nova_region_name': value => $nova_region_name;
'nova/auth_plugin': value => $auth_plugin;
}
if ! is_service_default ($nova_admin_tenant_id) {
if $nova_admin_tenant_id {
neutron_config {
'DEFAULT/nova_admin_tenant_id': value => $nova_admin_tenant_id;
}
}
} else {
neutron_config {
'DEFAULT/nova_admin_tenant_name': value => $nova_admin_tenant_name;
}
} else {
neutron_config {
'nova/auth_type': value => $auth_type;
}
}
if $password {
if ! is_service_default ($tenant_id) {
if $tenant_id {
neutron_config {
'nova/tenant_id': value => $tenant_id;
}
}
} else {
neutron_config {
'nova/auth_url': value => $auth_url;
'nova/username': value => $username;
'nova/password': value => $password, secret => true;
'nova/project_domain_id': value => $project_domain_id;
'nova/project_name': value => $project_name;
'nova/user_domain_id': value => $user_domain_id;
'nova/region_name': value => $region_name;
}
if ! is_service_default ($auth_plugin) and ($auth_plugin) {
warning('auth_plugin parameter is deprecated, auth_type should be used instead')
neutron_config {
'nova/auth_plugin': value => $auth_plugin;
}
} else {
neutron_config {
'nova/auth_type': value => $auth_type;
}
}
if ! is_service_default ($tenant_id) {
if $tenant_id {
neutron_config {
'nova/tenant_id': value => $tenant_id;
}
}
} else {
neutron_config {
'nova/tenant_name': value => $tenant_name;
}
'nova/tenant_name': value => $tenant_name;
}
}
@ -223,6 +143,5 @@ class neutron::server::notifications (
'DEFAULT/notify_nova_on_port_status_changes': value => $notify_nova_on_port_status_changes;
'DEFAULT/notify_nova_on_port_data_changes': value => $notify_nova_on_port_data_changes;
'DEFAULT/send_events_interval': value => $send_events_interval;
'DEFAULT/nova_url': value => $nova_url;
}
}

View File

@ -0,0 +1,6 @@
---
deprecations:
- The ``log_facility``, ``allow_sorting``, ``allow_pagination``,
``nova_url``, ``quota_items``, ``prevent_arp_spoofing``,
``advertise_mtu`` and ``nova_admin_*`` options were deprecated in newton
(or earlier) and have been removed for Ocata.

View File

@ -43,7 +43,6 @@ describe 'neutron::agents::ml2::ovs' do
is_expected.to contain_neutron_agent_ovs('agent/polling_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_agent_ovs('agent/l2_population').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_agent_ovs('agent/arp_responder').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_agent_ovs('agent/prevent_arp_spoofing').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_agent_ovs('agent/drop_flows_on_start').with_value(p[:drop_flows_on_start])
is_expected.to contain_neutron_agent_ovs('agent/extensions').with_value(['<SERVICE DEFAULT>'])
is_expected.to contain_neutron_agent_ovs('agent/minimize_polling').with_value(['<SERVICE DEFAULT>'])
@ -109,15 +108,6 @@ describe 'neutron::agents::ml2::ovs' do
end
end
context 'when disabling ARP Spoofing Protection' do
before :each do
params.merge!(:prevent_arp_spoofing => false)
end
it 'should disable ARP Spoofing Protection' do
is_expected.to contain_neutron_agent_ovs('agent/prevent_arp_spoofing').with_value(false)
end
end
context 'when enabling DVR' do
before :each do
params.merge!(:enable_distributed_routing => true,

View File

@ -16,24 +16,19 @@
require 'spec_helper'
describe 'neutron::server::notifications' do
let :pre_condition do
'define keystone_user() {}'
end
let :default_params do
let :params do
{
:notify_nova_on_port_status_changes => true,
:notify_nova_on_port_data_changes => true,
:auth_type => 'password',
:username => 'nova',
:password => 'secrete',
:tenant_name => 'services',
:project_domain_id => 'default',
:project_name => 'services',
:user_domain_id => 'default',
:auth_url => 'http://127.0.0.1:35357',
:nova_admin_auth_url => 'http://127.0.0.1:35357/v2.0',
:nova_admin_username => 'nova',
:nova_admin_tenant_name => 'services',
}
end
@ -43,16 +38,7 @@ describe 'neutron::server::notifications' do
}
end
let :params do
{
:password => 'secrete'
}
end
shared_examples_for 'neutron server notifications' do
let :p do
default_params.merge(params)
end
it 'configure neutron.conf' do
is_expected.to contain_neutron_config('DEFAULT/notify_nova_on_port_status_changes').with_value(true)
@ -65,12 +51,6 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('nova/password').with_secret( true )
is_expected.to contain_neutron_config('nova/tenant_name').with_value('services')
is_expected.to contain_neutron_config('nova/region_name').with_value('<SERVICE DEFAULT>')
is_expected.not_to contain_neutron_config('DEFAULT/nova_region_name')
is_expected.not_to contain_neutron_config('DEFAULT/nova_admin_auth_url')
is_expected.not_to contain_neutron_config('DEFAULT/nova_admin_username')
is_expected.not_to contain_neutron_config('DEFAULT/nova_admin_password')
is_expected.not_to contain_neutron_config('DEFAULT/nova_admin_password')
is_expected.not_to contain_neutron_config('DEFAULT/nova_admin_tenant_id')
is_expected.not_to contain_neutron_config('nova/auth_plugin')
end
@ -80,7 +60,6 @@ describe 'neutron::server::notifications' do
:notify_nova_on_port_status_changes => false,
:notify_nova_on_port_data_changes => false,
:send_events_interval => '10',
:nova_url => 'http://nova:8774/v3',
:auth_url => 'http://keystone:35357/v2.0',
:auth_type => 'v2password',
:username => 'joe',
@ -92,7 +71,6 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('DEFAULT/notify_nova_on_port_status_changes').with_value(false)
is_expected.to contain_neutron_config('DEFAULT/notify_nova_on_port_data_changes').with_value(false)
is_expected.to contain_neutron_config('DEFAULT/send_events_interval').with_value('10')
is_expected.to contain_neutron_config('DEFAULT/nova_url').with_value('http://nova:8774/v3')
is_expected.to contain_neutron_config('nova/auth_url').with_value('http://keystone:35357/v2.0')
is_expected.to contain_neutron_config('nova/auth_type').with_value('v2password')
is_expected.to contain_neutron_config('nova/username').with_value('joe')
@ -103,31 +81,6 @@ describe 'neutron::server::notifications' do
end
end
context 'when using deprecated parameters' do
before :each do
params.merge!(
:nova_admin_auth_url => 'http://keystone:35357/v2.0',
:nova_admin_username => 'joe',
:nova_admin_password => 'secrete',
:nova_region_name => 'MyRegion',
:nova_admin_tenant_id => 'UUID2',
:password => false
)
end
it 'should configure neutron server with deprecated parameters' do
is_expected.to contain_neutron_config('DEFAULT/nova_admin_auth_url').with_value('http://keystone:35357/v2.0')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_username').with_value('joe')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_password').with_value('secrete')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_password').with_secret( true )
is_expected.to contain_neutron_config('DEFAULT/nova_region_name').with_value('MyRegion')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_tenant_id').with_value('UUID2')
is_expected.not_to contain_neutron_config('nova/auth_url')
is_expected.not_to contain_neutron_config('nova/username')
is_expected.not_to contain_neutron_config('nova/password')
is_expected.not_to contain_neutron_config('nova/tenant_id')
end
end
context 'when auth_plugin is provided' do
before :each do
params.merge!(
@ -140,50 +93,14 @@ describe 'neutron::server::notifications' do
end
end
context 'when no nova_admin_password or password is specified' do
before :each do
params.merge!({
:nova_admin_password => false,
:password => false })
end
it_raises 'a Puppet::Error', /nova_admin_password or password must be set./
end
context 'when no nova_admin_tenant_id and nova_admin_tenant_name specified' do
before :each do
params.merge!({
:nova_admin_tenant_name => false,
:nova_admin_password => 'secrete',
})
end
it_raises 'a Puppet::Error', /You must provide either nova_admin_tenant_name or nova_admin_tenant_id./
end
context 'when no tenant_id and tenant_name specified' do
before :each do
params.merge!({
:tenant_name => false,
:password => 'secrete',
})
params.merge!({ :tenant_name => false })
end
it_raises 'a Puppet::Error', /You must provide either tenant_name or tenant_id./
end
context 'when providing a nova_tenant_name' do
before :each do
params.merge!({
:nova_admin_tenant_name => 'services',
:nova_admin_password => 'secrete',
:password => false
})
end
it 'should configure nova admin tenant name' do
is_expected.to contain_neutron_config('DEFAULT/nova_admin_tenant_name').with_value('services')
end
end
end
context 'on Debian platforms' do