From cd2cf2ebb8f7cf2619ac2856367ee4d83a9587f2 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 8 May 2014 00:56:15 +0200 Subject: [PATCH] Add API V3 support Ability to enable or not v3 API in nova-api service. Change-Id: Id1bf977434d83ac41e8d174ed8a1df0af946cb1c Signed-off-by: Emilien Macchi --- manifests/api.pp | 5 +++++ spec/classes/nova_api_spec.rb | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/manifests/api.pp b/manifests/api.pp index b7c88bcbc..65110722c 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -107,6 +107,9 @@ # (optional) The rate limiting factory to use # Defaults to 'nova.api.openstack.compute.limits:RateLimitingMiddleware.factory' # +# [*osapi_v3*] +# (optional) Enable or not Nova API v3 +# Defaults to false class nova::api( $admin_password, $enabled = false, @@ -131,6 +134,7 @@ $conductor_workers = $::processorcount, $sync_db = true, $neutron_metadata_proxy_shared_secret = undef, + $osapi_v3 = false, $ratelimits = undef, $ratelimits_factory = 'nova.api.openstack.compute.limits:RateLimitingMiddleware.factory', @@ -181,6 +185,7 @@ 'DEFAULT/metadata_workers': value => $metadata_workers; 'conductor/workers': value => $conductor_workers; 'DEFAULT/use_forwarded_for': value => $use_forwarded_for; + 'osapi_v3/enabled': value => $osapi_v3; } if ($neutron_metadata_proxy_shared_secret){ diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index 088fd51da..177a86e83 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -63,6 +63,10 @@ should contain_nova_config('conductor/workers').with('value' => '5') end + it 'do not configure v3 api' do + should contain_nova_config('osapi_v3/enabled').with('value' => false) + end + it 'unconfigures neutron_metadata proxy' do should contain_nova_config('DEFAULT/service_neutron_metadata_proxy').with(:value => false) should contain_nova_config('DEFAULT/neutron_metadata_proxy_shared_secret').with(:ensure => 'absent') @@ -103,6 +107,7 @@ :osapi_compute_workers => 1, :metadata_workers => 2, :conductor_workers => 3, + :osapi_v3 => true, }) end @@ -154,6 +159,10 @@ should contain_nova_config('DEFAULT/service_neutron_metadata_proxy').with('value' => true) should contain_nova_config('DEFAULT/neutron_metadata_proxy_shared_secret').with('value' => 'secrete') end + + it 'configure nova api v3' do + should contain_nova_config('osapi_v3/enabled').with('value' => true) + end end [