From 9eda865197d88040a7fc2b640a0fa23da290c18d Mon Sep 17 00:00:00 2001 From: Mike Dorman Date: Sat, 20 Dec 2014 16:13:40 -0700 Subject: [PATCH] Add optional network_api_class parameter to nova::network::neutron class This allows for overriding the default Neutron network API class in Nova. Change-Id: Ic2b1cce115720a4ac1208b38facbb82fdf273173 --- manifests/network/neutron.pp | 8 +++++++- spec/classes/nova_network_neutron_spec.rb | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/manifests/network/neutron.pp b/manifests/network/neutron.pp index bf95e900b..f9cc997ed 100644 --- a/manifests/network/neutron.pp +++ b/manifests/network/neutron.pp @@ -57,6 +57,11 @@ # and not the Identity service API IP and port. # Defaults to 'http://127.0.0.1:35357/v2.0' # +# [*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. @@ -99,6 +104,7 @@ 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, @@ -109,7 +115,7 @@ class nova::network::neutron ( nova_config { 'DEFAULT/dhcp_domain': value => $dhcp_domain; 'DEFAULT/firewall_driver': value => $firewall_driver; - 'DEFAULT/network_api_class': value => 'nova.network.neutronv2.api.API'; + '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; diff --git a/spec/classes/nova_network_neutron_spec.rb b/spec/classes/nova_network_neutron_spec.rb index e5fcd9dfd..20eaafc83 100644 --- a/spec/classes/nova_network_neutron_spec.rb +++ b/spec/classes/nova_network_neutron_spec.rb @@ -62,6 +62,7 @@ describe 'nova::network::neutron' do :neutron_region_name => 'RegionTwo', :neutron_admin_username => 'neutron2', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', + :network_api_class => 'network.api.class', :security_group_api => 'nova', :firewall_driver => 'nova.virt.firewall.IptablesFirewallDriver', :neutron_ovs_bridge => 'br-int', @@ -75,7 +76,7 @@ describe 'nova::network::neutron' do it 'configures neutron endpoint in nova.conf' do should contain_nova_config('neutron/auth_strategy').with_value(default_params[:neutron_auth_strategy]) should contain_nova_config('neutron/admin_password').with_value(params[:neutron_admin_password]).with_secret(true) - should contain_nova_config('DEFAULT/network_api_class').with_value('nova.network.neutronv2.api.API') + should contain_nova_config('DEFAULT/network_api_class').with_value('network.api.class') should contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain]) should contain_nova_config('neutron/url').with_value(params[:neutron_url]) should contain_nova_config('neutron/url_timeout').with_value(params[:neutron_url_timeout])