Remove deprecated metadata option from nova::api

Removes deprecated neutron_metadata_proxy_shared_secret and
metadata_cache_expiration parameter from nova::api class.

Change-Id: I1abc672e58d4685f75fa7c237486e781dcc9227e
This commit is contained in:
Martin Schuppert 2019-07-02 14:32:08 +02:00
parent 296b106916
commit 66f2e8e509
3 changed files with 5 additions and 35 deletions

View File

@ -168,14 +168,6 @@
# metadata handling from api class.
# Defaults to false
#
# [*neutron_metadata_proxy_shared_secret*]
# (optional) Shared secret to validate proxies Neutron metadata requests
# Defaults to undef
#
# [*metadata_cache_expiration*]
# (optional) This option is the time (in seconds) to cache metadata.
# Defaults to $::os_service_default
#
# [*fping_path*]
# (optional) Full path to fping.
# Defaults to undef
@ -196,7 +188,6 @@ class nova::api(
$sync_db = true,
$sync_db_api = true,
$db_online_data_migrations = false,
$neutron_metadata_proxy_shared_secret = undef,
$ratelimits = undef,
$ratelimits_factory =
'nova.api.openstack.compute.limits:RateLimitingMiddleware.factory',
@ -205,7 +196,6 @@ class nova::api(
$instance_name_template = undef,
$service_name = $::nova::params::api_service_name,
$enable_proxy_headers_parsing = $::os_service_default,
$metadata_cache_expiration = $::os_service_default,
$max_limit = $::os_service_default,
$compute_link_prefix = $::os_service_default,
$glance_link_prefix = $::os_service_default,
@ -301,20 +291,6 @@ as a standalone service, or httpd for being run by a httpd server")
'DEFAULT/metadata_workers': value => $metadata_workers;
'DEFAULT/metadata_listen': value => $metadata_listen;
'DEFAULT/metadata_listen_port': value => $metadata_listen_port;
'api/metadata_cache_expiration': value => $metadata_cache_expiration;
}
if ($neutron_metadata_proxy_shared_secret){
nova_config {
'neutron/service_metadata_proxy': value => true;
'neutron/metadata_proxy_shared_secret':
value => $neutron_metadata_proxy_shared_secret, secret => true;
}
} else {
nova_config {
'neutron/service_metadata_proxy': value => false;
'neutron/metadata_proxy_shared_secret': ensure => absent;
}
}
oslo::middleware {'nova_config':

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
Removes deprecated neutron_metadata_proxy_shared_secret and
metadata_cache_expiration parameter from nova::api class.

View File

@ -55,7 +55,6 @@ describe 'nova::api' do
is_expected.to contain_oslo__middleware('nova_config').with(
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
)
is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('api/max_limit').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('api/compute_link_prefix').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('api/glance_link_prefix').with('value' => '<SERVICE DEFAULT>')
@ -66,11 +65,6 @@ describe 'nova::api' do
is_expected.to contain_nova_config('DEFAULT/password_length').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/allow_resize_to_same_host').with('value' => false)
end
it 'unconfigures neutron_metadata proxy' do
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with(:value => false)
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with(:ensure => 'absent')
end
end
context 'with overridden parameters' do
@ -84,11 +78,9 @@ describe 'nova::api' do
:osapi_compute_listen_port => 8874,
:use_forwarded_for => false,
:ratelimits => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)',
:neutron_metadata_proxy_shared_secret => 'secrete',
:osapi_compute_workers => 1,
:metadata_workers => 2,
:enable_proxy_headers_parsing => true,
:metadata_cache_expiration => 15,
:max_limit => 1000,
:compute_link_prefix => 'https://10.0.0.1:7777/',
:glance_link_prefix => 'https://10.0.0.1:6666/',
@ -124,12 +116,9 @@ describe 'nova::api' do
is_expected.to contain_nova_config('api/use_forwarded_for').with('value' => false)
is_expected.to contain_nova_config('DEFAULT/osapi_compute_workers').with('value' => '1')
is_expected.to contain_nova_config('DEFAULT/metadata_workers').with('value' => '2')
is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '15')
is_expected.to contain_nova_config('api/max_limit').with('value' => '1000')
is_expected.to contain_nova_config('api/compute_link_prefix').with('value' => 'https://10.0.0.1:7777/')
is_expected.to contain_nova_config('api/glance_link_prefix').with('value' => 'https://10.0.0.1:6666/')
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with('value' => true)
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with('value' => 'secrete').with_secret(true)
is_expected.to contain_oslo__middleware('nova_config').with(
:enable_proxy_headers_parsing => true,
)