Deprecate parameters that have been removed from cinder

Deprecate the following parameters, which were removed from cinder
during the Queens cycle [1],[2].

- glance_api_version
- nova_catalog_info
- os_privileged_user_name
- os_privileged_user_password
- os_privileged_user_tenant
- os_privileged_user_auth_url

[1] https://review.openstack.org/502190
[2] https://review.openstack.org/503596

Closes-Bug: #1790217
Change-Id: I973563145dacc7bd2b1ee43daff9c84d30bf2732
This commit is contained in:
Alan Bishop 2018-09-05 13:47:47 -04:00
parent 99c58fb382
commit 3c634d2794
5 changed files with 87 additions and 149 deletions

View File

@ -4,28 +4,6 @@
#
# === Parameters
#
# [*privileged_user*]
# (optional) Enables OpenStack privileged account.
# Defaults to false.
#
# [*os_privileged_user_name*]
# (optional) OpenStack privileged account username. Used for requests to
# other services (such as Nova) that require an account with
# special rights.
# Defaults to $::os_service_default.
#
# [*os_privileged_user_password*]
# (optional) Password associated with the OpenStack privileged account.
# Defaults to $::os_service_default.
#
# [*os_privileged_user_tenant*]
# (optional) Tenant name associated with the OpenStack privileged account.
# Defaults to $::os_service_default.
#
# [*os_privileged_user_auth_url*]
# (optional) Auth URL associated with the OpenStack privileged account.
# Defaults to $::os_service_default.
#
# [*keymgr_encryption_api_url*]
# (optional) Key Manager service URL
# Example of valid value: https://localhost:9311/v1
@ -42,11 +20,6 @@
# requests. For example, boot-from-volume.
# Defaults to $::os_service_default
#
# [*nova_catalog_info*]
# (optional) Match this value when searching for nova in the service
# catalog.
# Defaults to 'compute:Compute Service:publicURL'
#
# [*service_workers*]
# (optional) Number of cinder-api workers
# Defaults to $::os_workers
@ -154,18 +127,35 @@
# Example of valid value: castellan.key_manager.barbican_key_manager.BarbicanKeyManager
# Defaults to undef.
#
# [*nova_catalog_admin_info*]
# (optional) Same as nova_catalog_info, but for admin endpoint.
# Defaults to 'compute:Compute Service:adminURL'
# [*nova_catalog_info*]
# (optional) Match this value when searching for nova in the service
# catalog.
# Defaults to undef.
#
# [*os_privileged_user_name*]
# (optional) OpenStack privileged account username. Used for requests to
# other services (such as Nova) that require an account with
# special rights.
# Defaults to undef.
#
# [*os_privileged_user_password*]
# (optional) Password associated with the OpenStack privileged account.
# Defaults to undef.
#
# [*os_privileged_user_tenant*]
# (optional) Tenant name associated with the OpenStack privileged account.
# Defaults to undef.
#
# [*os_privileged_user_auth_url*]
# (optional) Auth URL associated with the OpenStack privileged account.
# Defaults to undef.
#
# [*privileged_user*]
# (optional) Enables OpenStack privileged account.
# Defaults to undef.
#
class cinder::api (
$nova_catalog_info = 'compute:Compute Service:publicURL',
$os_region_name = $::os_service_default,
$privileged_user = false,
$os_privileged_user_name = $::os_service_default,
$os_privileged_user_password = $::os_service_default,
$os_privileged_user_tenant = $::os_service_default,
$os_privileged_user_auth_url = $::os_service_default,
$keymgr_encryption_api_url = $::os_service_default,
$keymgr_encryption_auth_url = $::os_service_default,
$service_workers = $::os_workers,
@ -193,7 +183,12 @@ class cinder::api (
$keymgr_backend = 'cinder.keymgr.conf_key_mgr.ConfKeyManager',
# DEPRECATED PARAMETERS
$keymgr_api_class = undef,
$nova_catalog_admin_info = 'compute:Compute Service:adminURL',
$nova_catalog_info = undef,
$os_privileged_user_name = undef,
$os_privileged_user_password = undef,
$os_privileged_user_tenant = undef,
$os_privileged_user_auth_url = undef,
$privileged_user = undef,
) inherits cinder::params {
include ::cinder::deps
@ -203,8 +198,19 @@ class cinder::api (
validate_bool($manage_service)
validate_bool($enabled)
if $nova_catalog_admin_info {
warning('The nova_catalog_admin_info parameter has been deprecated and will be removed in the future release.')
$deprecated_param_names = [
'nova_catalog_info',
'privileged_user',
'os_privileged_user_name',
'os_privileged_user_password',
'os_privileged_user_tenant',
'os_privileged_user_auth_url',
]
$deprecated_param_names.each |$param_name| {
$param = getvar("${param_name}")
if $param != undef{
warning("The ${param_name} parameter is deprecated, has no effect and will be removed in the future release.")
}
}
if $use_ssl {
@ -283,33 +289,10 @@ running as a standalone service, or httpd for being run by a httpd server")
'DEFAULT/auth_strategy': value => $auth_strategy;
}
cinder_config {
'DEFAULT/nova_catalog_info': value => $nova_catalog_info;
}
oslo::middleware {'cinder_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
}
if $privileged_user {
if is_service_default($os_privileged_user_name) {
fail('The os_privileged_user_name parameter is required when privileged_user is set to true')
}
if is_service_default($os_privileged_user_password) {
fail('The os_privileged_user_password parameter is required when privileged_user is set to true')
}
if is_service_default($os_privileged_user_tenant) {
fail('The os_privileged_user_tenant parameter is required when privileged_user is set to true')
}
}
cinder_config {
'DEFAULT/os_privileged_user_password': value => $os_privileged_user_password;
'DEFAULT/os_privileged_user_tenant': value => $os_privileged_user_tenant;
'DEFAULT/os_privileged_user_name': value => $os_privileged_user_name;
'DEFAULT/os_privileged_user_auth_url': value => $os_privileged_user_auth_url;
}
cinder_config {
'key_manager/backend': value => $keymgr_backend_real;
'barbican/barbican_endpoint': value => $keymgr_encryption_api_url;

View File

@ -9,11 +9,6 @@
# Should be an array with [hostname|ip]:port
# Defaults to undef
#
# [*glance_api_version*]
# (optional) Glance API version.
# Should be 1 or 2
# Defaults to 2 (current version)
#
# [*glance_num_retries*]
# (optional) Number retries when downloading an image from glance.
# Defaults to $::os_service_default
@ -34,6 +29,12 @@
# (optional) http/https timeout value for glance operations.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*glance_api_version*]
# (optional) Glance API version.
# Defaults to undef.
#
# === Author(s)
#
# Emilien Macchi <emilien.macchi@enovance.com>
@ -56,18 +57,22 @@
#
class cinder::glance (
$glance_api_servers = undef,
$glance_api_version = '2',
$glance_num_retries = $::os_service_default,
$glance_api_insecure = $::os_service_default,
$glance_api_ssl_compression = $::os_service_default,
$glance_request_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$glance_api_version = undef,
) {
include ::cinder::deps
if $glance_api_version != undef {
warning("The glance_api_version parameter is deprecated, has no effect and will be removed in the future release.")
}
cinder_config {
'DEFAULT/glance_api_servers': value => join(any2array($glance_api_servers), ',');
'DEFAULT/glance_api_version': value => $glance_api_version;
'DEFAULT/glance_num_retries': value => $glance_num_retries;
'DEFAULT/glance_api_insecure': value => $glance_api_insecure;
'DEFAULT/glance_api_ssl_compression': value => $glance_api_ssl_compression;

View File

@ -0,0 +1,12 @@
---
deprecations:
- |
The following parameters are deprecated because support for them was
removed from cinder during the Queens cycle.
* glance_api_version
* nova_catalog_info
* os_privileged_user_name
* os_privileged_user_password
* os_privileged_user_tenant
* os_privileged_user_auth_url

View File

@ -31,9 +31,8 @@ describe 'cinder::api' do
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_workers').with(
:value => '8'
)
is_expected.to contain_cinder_config('DEFAULT/nova_catalog_info').with(
:value => 'compute:Compute Service:publicURL'
)
# nova_catalog_info has been deprecated
is_expected.not_to contain_cinder_config('DEFAULT/nova_catalog_info')
is_expected.to contain_cinder_config('DEFAULT/default_volume_type').with(
:value => '<SERVICE DEFAULT>'
)
@ -53,10 +52,6 @@ describe 'cinder::api' do
:value => 'keystone'
)
is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_tenant').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_auth_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('key_manager/backend').with_value('cinder.keymgr.conf_key_mgr.ConfKeyManager')
is_expected.to contain_cinder_config('barbican/barbican_endpoint').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('barbican/auth_endpoint').with_value('<SERVICE DEFAULT>')
@ -67,13 +62,24 @@ describe 'cinder::api' do
end
end
describe 'with a custom nova_catalog params' do
describe 'with deprecated parameters' do
let :params do
req_params.merge({
'nova_catalog_info' => 'compute:nova:publicURL',
'nova_catalog_info' => 'compute:nova:publicURL',
'os_privileged_user_name' => 'admin',
'os_privileged_user_password' => 'password',
'os_privileged_user_tenant' => 'admin',
'os_privileged_user_auth_url' => 'http://localhost:8080',
})
end
it { is_expected.to contain_cinder_config('DEFAULT/nova_catalog_info').with_value('compute:nova:publicURL') }
it 'should not add them to the config' do
is_expected.not_to contain_cinder_config('DEFAULT/nova_catalog_info')
is_expected.not_to contain_cinder_config('DEFAULT/os_privileged_user_name')
is_expected.not_to contain_cinder_config('DEFAULT/os_privileged_user_password')
is_expected.not_to contain_cinder_config('DEFAULT/os_privileged_user_tenant')
is_expected.not_to contain_cinder_config('DEFAULT/os_privileged_user_auth_url')
end
end
describe 'with a custom region for nova' do
@ -98,75 +104,6 @@ describe 'cinder::api' do
end
end
describe 'with an OpenStack privileged account' do
context 'with all needed params' do
let :params do
req_params.merge({
'privileged_user' => 'true',
'os_privileged_user_name' => 'admin',
'os_privileged_user_password' => 'password',
'os_privileged_user_tenant' => 'admin',
'os_privileged_user_auth_url' => 'http://localhost:8080',
})
end
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_name').with_value('admin') }
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_password').with_value('password') }
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_tenant').with_value('admin') }
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_auth_url').with_value('http://localhost:8080') }
end
context 'without os_privileged_user_auth_url' do
let :params do
req_params.merge({
'privileged_user' => 'true',
'os_privileged_user_name' => 'admin',
'os_privileged_user_password' => 'password',
'os_privileged_user_tenant' => 'admin',
})
end
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_name').with_value('admin') }
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_password').with_value('password') }
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_tenant').with_value('admin') }
it { is_expected.to contain_cinder_config('DEFAULT/os_privileged_user_auth_url').with_value('<SERVICE DEFAULT>') }
end
context 'without os_privileged_user' do
let :params do
req_params.merge({
'privileged_user' => 'true',
})
end
it_raises 'a Puppet::Error', /The os_privileged_user_name parameter is required when privileged_user is set to true/
end
context 'without os_privileged_user_password' do
let :params do
req_params.merge({
'privileged_user' => 'true',
'os_privileged_user_name' => 'admin',
})
end
it_raises 'a Puppet::Error', /The os_privileged_user_password parameter is required when privileged_user is set to true/
end
context 'without os_privileged_user_tenant' do
let :params do
req_params.merge({
'privileged_user' => 'true',
'os_privileged_user_name' => 'admin',
'os_privileged_user_password' => 'password',
})
end
it_raises 'a Puppet::Error', /The os_privileged_user_tenant parameter is required when privileged_user is set to true/
end
end
describe 'with a default volume type' do
let :params do
req_params.merge({'default_volume_type' => 'foo'})

View File

@ -40,7 +40,8 @@ describe 'cinder::glance' do
end
it 'configures cinder.conf with default params' do
is_expected.to contain_cinder_config('DEFAULT/glance_api_version').with_value(p[:glance_api_version])
# glance_api_version is fully deprecated from cinder, and should not be added to the config.
is_expected.not_to contain_cinder_config('DEFAULT/glance_api_version')
is_expected.to contain_cinder_config('DEFAULT/glance_num_retries').with_value(p[:glance_num_retries])
is_expected.to contain_cinder_config('DEFAULT/glance_api_insecure').with_value(p[:glance_api_insecure])
is_expected.to contain_cinder_config('DEFAULT/glance_api_ssl_compression').with_value(p[:glance_api_ssl_compression])