From 3201927ce35c1c64b502ab27f8d9083d6c8a65a3 Mon Sep 17 00:00:00 2001 From: Sergey Kolekonov Date: Tue, 15 Mar 2016 18:53:26 +0300 Subject: [PATCH] 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 --- manifests/network/neutron.pp | 17 ++++++++++------- ...cate_network_api_class-557e9ac007c97feb.yaml | 6 ++++++ spec/classes/nova_network_neutron_spec.rb | 6 +----- 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/deprecate_network_api_class-557e9ac007c97feb.yaml diff --git a/manifests/network/neutron.pp b/manifests/network/neutron.pp index bd0981834..ffbd4cdbf 100644 --- a/manifests/network/neutron.pp +++ b/manifests/network/neutron.pp @@ -63,11 +63,6 @@ # and not the Identity service API IP and port. # 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*] # (optional) The full class name of the security API class. # The default configures Nova to use Neutron for security groups. @@ -125,6 +120,10 @@ # [*neutron_default_tenant_id*] # (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 ( $neutron_password = false, $neutron_auth_plugin = 'v3password', @@ -139,7 +138,6 @@ class nova::network::neutron ( $neutron_ovs_bridge = 'br-int', $neutron_extension_sync_interval = '600', $neutron_ca_certificates_file = undef, - $network_api_class = 'nova.network.neutronv2.api.API', $security_group_api = 'neutron', $firewall_driver = 'nova.virt.firewall.NoopFirewallDriver', $vif_plugging_is_fatal = true, @@ -152,10 +150,15 @@ class nova::network::neutron ( $neutron_admin_username = undef, $neutron_admin_auth_url = undef, $neutron_default_tenant_id = undef, + $network_api_class = undef, ) { include ::nova::deps + if $network_api_class != undef { + warning('network_api_class has no effect') + } + # neutron_admin params removed in Mitaka if $neutron_password { $neutron_password_real = $neutron_password @@ -213,10 +216,10 @@ class nova::network::neutron ( nova_config { 'DEFAULT/dhcp_domain': value => $dhcp_domain; 'DEFAULT/firewall_driver': value => $firewall_driver; - 'DEFAULT/network_api_class': value => $network_api_class; 'DEFAULT/security_group_api': value => $security_group_api; 'DEFAULT/vif_plugging_is_fatal': value => $vif_plugging_is_fatal; 'DEFAULT/vif_plugging_timeout': value => $vif_plugging_timeout; + 'DEFAULT/use_neutron': value => true; 'neutron/url': value => $neutron_url; 'neutron/timeout': value => $neutron_url_timeout; 'neutron/project_name': value => $neutron_project_name_real; diff --git a/releasenotes/notes/deprecate_network_api_class-557e9ac007c97feb.yaml b/releasenotes/notes/deprecate_network_api_class-557e9ac007c97feb.yaml new file mode 100644 index 000000000..e8a2c2a02 --- /dev/null +++ b/releasenotes/notes/deprecate_network_api_class-557e9ac007c97feb.yaml @@ -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 diff --git a/spec/classes/nova_network_neutron_spec.rb b/spec/classes/nova_network_neutron_spec.rb index 2128f7197..255bc80fa 100644 --- a/spec/classes/nova_network_neutron_spec.rb +++ b/spec/classes/nova_network_neutron_spec.rb @@ -29,8 +29,8 @@ describe 'nova::network::neutron' do context 'with required parameters' 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('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/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/url').with_value(default_params[:neutron_url]) 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_user_domain_name => 'neutron_domain', :neutron_auth_url => 'http://10.0.0.1:35357/v2', - :network_api_class => 'network.api.class', :security_group_api => 'nova', :firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver', :neutron_ovs_bridge => 'br-int', @@ -79,7 +78,6 @@ describe 'nova::network::neutron' 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/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('neutron/url').with_value(params[:neutron_url]) 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_admin_username => 'neutron2', :neutron_admin_auth_url => 'http://10.0.0.1:35357', - :network_api_class => 'network.api.class', :security_group_api => 'nova', :firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver', :neutron_ovs_bridge => 'br-int', @@ -127,7 +124,6 @@ describe 'nova::network::neutron' 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/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('neutron/url').with_value(params[:neutron_url]) is_expected.to contain_nova_config('neutron/timeout').with_value(params[:neutron_url_timeout])