Do not use network_api_class option

network_api_class is deprecated in Neutron and will be removed.
Set use_neutron to true as nova::network::neutron is a Neutron-specific class,
network_api_class parameter becomes useless and doesn't take any effect

Change-Id: Ifc1b569c21e3bff6d160c8c5ac28895de28e6370
This commit is contained in:
Sergey Kolekonov
2016-03-15 18:53:26 +03:00
parent f0709b7d23
commit 3201927ce3
3 changed files with 17 additions and 12 deletions

View File

@@ -63,11 +63,6 @@
# and not the Identity service API IP and port. # and not the Identity service API IP and port.
# Defaults to 'http://127.0.0.1:35357/v3' # Defaults to 'http://127.0.0.1:35357/v3'
# #
# [*network_api_class*]
# (optional) The full class name of the network API class.
# The default configures Nova to use Neutron for the network API.
# Defaults to 'nova.network.neutronv2.api.API'
#
# [*security_group_api*] # [*security_group_api*]
# (optional) The full class name of the security API class. # (optional) The full class name of the security API class.
# The default configures Nova to use Neutron for security groups. # The default configures Nova to use Neutron for security groups.
@@ -125,6 +120,10 @@
# [*neutron_default_tenant_id*] # [*neutron_default_tenant_id*]
# (optional) DEPRECATED. Default tenant id when creating neutron networks # (optional) DEPRECATED. Default tenant id when creating neutron networks
# #
# [*network_api_class*]
# (optional) DEPRECATED. The full class name of the network API class.
# This parameter has no effect
#
class nova::network::neutron ( class nova::network::neutron (
$neutron_password = false, $neutron_password = false,
$neutron_auth_plugin = 'v3password', $neutron_auth_plugin = 'v3password',
@@ -139,7 +138,6 @@ class nova::network::neutron (
$neutron_ovs_bridge = 'br-int', $neutron_ovs_bridge = 'br-int',
$neutron_extension_sync_interval = '600', $neutron_extension_sync_interval = '600',
$neutron_ca_certificates_file = undef, $neutron_ca_certificates_file = undef,
$network_api_class = 'nova.network.neutronv2.api.API',
$security_group_api = 'neutron', $security_group_api = 'neutron',
$firewall_driver = 'nova.virt.firewall.NoopFirewallDriver', $firewall_driver = 'nova.virt.firewall.NoopFirewallDriver',
$vif_plugging_is_fatal = true, $vif_plugging_is_fatal = true,
@@ -152,10 +150,15 @@ class nova::network::neutron (
$neutron_admin_username = undef, $neutron_admin_username = undef,
$neutron_admin_auth_url = undef, $neutron_admin_auth_url = undef,
$neutron_default_tenant_id = undef, $neutron_default_tenant_id = undef,
$network_api_class = undef,
) { ) {
include ::nova::deps include ::nova::deps
if $network_api_class != undef {
warning('network_api_class has no effect')
}
# neutron_admin params removed in Mitaka # neutron_admin params removed in Mitaka
if $neutron_password { if $neutron_password {
$neutron_password_real = $neutron_password $neutron_password_real = $neutron_password
@@ -213,10 +216,10 @@ class nova::network::neutron (
nova_config { nova_config {
'DEFAULT/dhcp_domain': value => $dhcp_domain; 'DEFAULT/dhcp_domain': value => $dhcp_domain;
'DEFAULT/firewall_driver': value => $firewall_driver; 'DEFAULT/firewall_driver': value => $firewall_driver;
'DEFAULT/network_api_class': value => $network_api_class;
'DEFAULT/security_group_api': value => $security_group_api; 'DEFAULT/security_group_api': value => $security_group_api;
'DEFAULT/vif_plugging_is_fatal': value => $vif_plugging_is_fatal; 'DEFAULT/vif_plugging_is_fatal': value => $vif_plugging_is_fatal;
'DEFAULT/vif_plugging_timeout': value => $vif_plugging_timeout; 'DEFAULT/vif_plugging_timeout': value => $vif_plugging_timeout;
'DEFAULT/use_neutron': value => true;
'neutron/url': value => $neutron_url; 'neutron/url': value => $neutron_url;
'neutron/timeout': value => $neutron_url_timeout; 'neutron/timeout': value => $neutron_url_timeout;
'neutron/project_name': value => $neutron_project_name_real; 'neutron/project_name': value => $neutron_project_name_real;

View File

@@ -0,0 +1,6 @@
---
deprecations:
- network_api_class parameter from nova::network::neutron doesn't take effect
anymore and will be removed in future.
Set use_neutron always to true as nova::network::neutron is
a Neutron-specific class

View File

@@ -29,8 +29,8 @@ describe 'nova::network::neutron' do
context 'with required parameters' do context 'with required parameters' do
it 'configures neutron endpoint in nova.conf' do it 'configures neutron endpoint in nova.conf' do
is_expected.to contain_nova_config('neutron/password').with_value(params[:neutron_password]).with_secret(true) is_expected.to contain_nova_config('neutron/password').with_value(params[:neutron_password]).with_secret(true)
is_expected.to contain_nova_config('DEFAULT/network_api_class').with_value('nova.network.neutronv2.api.API')
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(default_params[:dhcp_domain]) is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(default_params[:dhcp_domain])
is_expected.to contain_nova_config('DEFAULT/use_neutron').with_value(true)
is_expected.to contain_nova_config('neutron/auth_plugin').with_value(default_params[:neutron_auth_plugin]) is_expected.to contain_nova_config('neutron/auth_plugin').with_value(default_params[:neutron_auth_plugin])
is_expected.to contain_nova_config('neutron/url').with_value(default_params[:neutron_url]) is_expected.to contain_nova_config('neutron/url').with_value(default_params[:neutron_url])
is_expected.to contain_nova_config('neutron/timeout').with_value(default_params[:neutron_url_timeout]) is_expected.to contain_nova_config('neutron/timeout').with_value(default_params[:neutron_url_timeout])
@@ -65,7 +65,6 @@ describe 'nova::network::neutron' do
:neutron_username => 'neutron2', :neutron_username => 'neutron2',
:neutron_user_domain_name => 'neutron_domain', :neutron_user_domain_name => 'neutron_domain',
:neutron_auth_url => 'http://10.0.0.1:35357/v2', :neutron_auth_url => 'http://10.0.0.1:35357/v2',
:network_api_class => 'network.api.class',
:security_group_api => 'nova', :security_group_api => 'nova',
:firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver', :firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver',
:neutron_ovs_bridge => 'br-int', :neutron_ovs_bridge => 'br-int',
@@ -79,7 +78,6 @@ describe 'nova::network::neutron' do
it 'configures neutron endpoint in nova.conf' do it 'configures neutron endpoint in nova.conf' do
is_expected.to contain_nova_config('neutron/auth_strategy').with_ensure('absent') is_expected.to contain_nova_config('neutron/auth_strategy').with_ensure('absent')
is_expected.to contain_nova_config('neutron/password').with_value(params[:neutron_password]).with_secret(true) is_expected.to contain_nova_config('neutron/password').with_value(params[:neutron_password]).with_secret(true)
is_expected.to contain_nova_config('DEFAULT/network_api_class').with_value('network.api.class')
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain]) is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain])
is_expected.to contain_nova_config('neutron/url').with_value(params[:neutron_url]) is_expected.to contain_nova_config('neutron/url').with_value(params[:neutron_url])
is_expected.to contain_nova_config('neutron/timeout').with_value(params[:neutron_url_timeout]) is_expected.to contain_nova_config('neutron/timeout').with_value(params[:neutron_url_timeout])
@@ -113,7 +111,6 @@ describe 'nova::network::neutron' do
:neutron_region_name => 'RegionTwo', :neutron_region_name => 'RegionTwo',
:neutron_admin_username => 'neutron2', :neutron_admin_username => 'neutron2',
:neutron_admin_auth_url => 'http://10.0.0.1:35357', :neutron_admin_auth_url => 'http://10.0.0.1:35357',
:network_api_class => 'network.api.class',
:security_group_api => 'nova', :security_group_api => 'nova',
:firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver', :firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver',
:neutron_ovs_bridge => 'br-int', :neutron_ovs_bridge => 'br-int',
@@ -127,7 +124,6 @@ describe 'nova::network::neutron' do
it 'configures neutron endpoint in nova.conf' do it 'configures neutron endpoint in nova.conf' do
is_expected.to contain_nova_config('neutron/auth_strategy').with_ensure('absent') is_expected.to contain_nova_config('neutron/auth_strategy').with_ensure('absent')
is_expected.to contain_nova_config('neutron/password').with_value(params[:neutron_password]).with_secret(true) is_expected.to contain_nova_config('neutron/password').with_value(params[:neutron_password]).with_secret(true)
is_expected.to contain_nova_config('DEFAULT/network_api_class').with_value('network.api.class')
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain]) is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain])
is_expected.to contain_nova_config('neutron/url').with_value(params[:neutron_url]) is_expected.to contain_nova_config('neutron/url').with_value(params[:neutron_url])
is_expected.to contain_nova_config('neutron/timeout').with_value(params[:neutron_url_timeout]) is_expected.to contain_nova_config('neutron/timeout').with_value(params[:neutron_url_timeout])