Merge "Cleanup deprecared parameters for nova and neutron"

This commit is contained in:
Zuul 2020-04-27 19:27:19 +00:00 committed by Gerrit Code Review
commit e8916656ec
5 changed files with 43 additions and 249 deletions

View File

@ -51,43 +51,6 @@
# Only required if auth_type has been set to "password"
# Defaults to undef
#
# === DEPRECATED PARAMETERS
#
# [*nova_catalog_info*]
# (optional) Info to match when looking for nova in the service
# catalog. Format is: separated values of the form
# <service_type>:<service_name>:<endpoint_type>
# Defaults to undef
#
# [*nova_catalog_admin_info*]
# (optional) Same as nova_catalog_info, but for admin endpoint
# Defaults to undef
#
# [*nova_api_insecure*]
# Allow to perform insecure SSL requests to nova
# Defaults to undef
#
# [*nova_ca_certificates_file*]
# (optional) Location of CA certificates file to use for nova client requests
# (string value)
# Defaults to undef
#
# [*nova_admin_username*]
# (optional) Nova admin username
# Defaults to undef
#
# [*nova_admin_password*]
# (optional) Nova admin password
# Defaults to undef
#
# [*nova_admin_tenant_name*]
# (optional) Nova admin tenant name
# Defaults to undef
#
# [*nova_admin_auth_url*]
# (optional) Identity service url
# Defaults to undef
#
class manila::compute::nova (
$insecure = $::os_service_default,
$auth_url = $::os_service_default,
@ -100,73 +63,25 @@ class manila::compute::nova (
$endpoint_type = $::os_service_default,
$username = 'nova',
$password = undef,
# DEPRECATED PARAMETERS
$nova_catalog_info = undef,
$nova_catalog_admin_info = undef,
$nova_api_insecure = undef,
$nova_ca_certificates_file = undef,
$nova_admin_username = undef,
$nova_admin_password = undef,
$nova_admin_tenant_name = undef,
$nova_admin_auth_url = undef,
) {
include manila::deps
if $nova_catalog_info {
warning('The nova_catalog_info parameter is deprecated, has no effect and will be removed in a future release.')
}
if $nova_catalog_admin_info {
warning('The nova_catalog_admin_info parameter is deprecated, has no effect and will be removed in a future release.')
}
if $nova_api_insecure {
warning('The nova_api_insecure parameter is deprecated, use insecure instead.')
}
if $nova_ca_certificates_file {
warning('The nova_ca_certificates_file parameter is deprecated, use cafile instead.')
}
if $nova_admin_username {
warning('The nova_admin_username parameter is deprecated, use username instead.')
}
if $nova_admin_password {
warning('The nova_admin_password parameter is deprecated, use password instead.')
}
if $nova_admin_tenant_name {
warning('The nova_admin_tenant_name parameter is deprecated, use project_name instead.')
}
if $nova_admin_auth_url {
warning('The nova_admin_auth_url parameter is deprecated, use auth_url instead.')
}
$insecure_real = pick($nova_api_insecure, $insecure)
$cafile_real = pick($nova_ca_certificates_file, $cafile)
$username_real = pick($nova_admin_username, $username)
$password_real = pick_default($nova_admin_password, $password)
$project_name_real = pick($nova_admin_tenant_name, $project_name)
$auth_url_real = pick($nova_admin_auth_url, $auth_url)
manila_config {
'nova/insecure': value => $insecure_real;
'nova/auth_url': value => $auth_url_real;
'nova/insecure': value => $insecure;
'nova/auth_url': value => $auth_url;
'nova/auth_type': value => $auth_type;
'nova/cafile': value => $cafile_real;
'nova/cafile': value => $cafile;
'nova/region_name': value => $region_name;
'nova/endpoint_type': value => $endpoint_type;
}
if $auth_type == 'password' {
manila_config {
'nova/username': value => $username_real;
'nova/username': value => $username;
'nova/user_domain_name': value => $user_domain_name;
'nova/password': value => $password_real, secret => true;
'nova/project_name': value => $project_name_real;
'nova/password': value => $password, secret => true;
'nova/project_name': value => $project_name;
'nova/project_domain_name': value => $project_domain_name;
}
}

View File

@ -62,50 +62,6 @@
# (optional) whether to support IPv6 network resource
# Defaults to $::os_service_default
#
# === DEPRECATED PARAMETERS
#
# [*neutron_api_insecure*]
# (optional) if set, ignore any SSL validation issues
# Defaults to undef
#
# [*neutron_ca_certificates_file*]
# (optional) Location of ca certificates file to use for
# neutron client requests.
# Defaults to undef
#
# [*neutron_url*]
# (optional) URL for connecting to neutron
# Defaults to undef
#
# [*neutron_url_timeout*]
# (optional) timeout value for connecting to neutron in seconds
# Defaults to undef
#
# [*neutron_admin_username*]
# (optional) username for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_admin_password*]
# (optional) password for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_admin_tenant_name*]
# (optional) Tenant name for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_region_name*]
# (optional) region name for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_admin_auth_url*]
# (optional) auth url for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_auth_strategy*]
# (optional) auth strategy for connecting to
# neutron in admin context.
# Defaults to undef
#
class manila::network::neutron (
$insecure = $::os_service_default,
$auth_url = $::os_service_default,
@ -121,78 +77,18 @@ class manila::network::neutron (
$password = undef,
$network_plugin_ipv4_enabled = $::os_service_default,
$network_plugin_ipv6_enabled = $::os_service_default,
# DEPRECATED PARAMETERS
$neutron_api_insecure = undef,
$neutron_ca_certificates_file = undef,
$neutron_url = undef,
$neutron_url_timeout = undef,
$neutron_admin_username = undef,
$neutron_admin_password = undef,
$neutron_admin_tenant_name = undef,
$neutron_region_name = undef,
$neutron_admin_auth_url = undef,
$neutron_auth_strategy = undef,
) {
if $neutron_api_insecure {
warning('The neutron_api_insecure parameter is deprecated, use insecure instead.')
}
if $neutron_ca_certificates_file {
warning('The neutron_ca_certificates_file parameter is deprecated, use cafile instead.')
}
if $neutron_url {
warning('The neutron_url parameter is deprecated, has no effect and will be removed in a future release.')
}
if $neutron_url_timeout {
warning('The neutron_url_timeout parameter is deprecated, use timeout instead.')
}
if $neutron_admin_username {
warning('The neutron_admin_username parameter is deprecated, use username instead.')
}
if $neutron_admin_password {
warning('The neutron_admin_password parameter is deprecated, use password instead.')
}
if $neutron_admin_tenant_name {
warning('The neutron_admin_tenant_name parameter is deprecated, use project_name instead.')
}
if $neutron_region_name {
warning('The neutron_region_name parameter is deprecated, use region_name instead.')
}
if $neutron_admin_auth_url {
warning('The neutron_admin_auth_url parameter is deprecated, use auth_url instead.')
}
if $neutron_auth_strategy {
warning('The neutron_url parameter is deprecated, has no effect and will be removed in a future release.')
}
$insecure_real = pick($neutron_api_insecure, $insecure)
$auth_url_real = pick($neutron_admin_auth_url, $auth_url)
$cafile_real = pick($neutron_ca_certificates_file, $cafile)
$project_name_real = pick($neutron_admin_tenant_name, $project_name)
$region_name_real = pick($neutron_region_name, $region_name)
$timeout_real = pick($neutron_url_timeout, $timeout)
$username_real = pick($neutron_admin_username, $username)
$password_real = pick_default($neutron_admin_password, $password)
$neutron_plugin_name = 'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin'
manila_config {
'DEFAULT/network_api_class': value => $neutron_plugin_name;
'neutron/insecure': value => $insecure_real;
'neutron/auth_url': value => $auth_url_real;
'neutron/insecure': value => $insecure;
'neutron/auth_url': value => $auth_url;
'neutron/auth_type': value => $auth_type;
'neutron/cafile': value => $cafile_real;
'neutron/region_name': value => $region_name_real;
'neutron/timeout': value => $timeout_real;
'neutron/cafile': value => $cafile;
'neutron/region_name': value => $region_name;
'neutron/timeout': value => $timeout;
'neutron/endpoint_type': value => $endpoint_type;
'DEFAULT/network_plugin_ipv4_enabled': value => $network_plugin_ipv4_enabled;
'DEFAULT/network_plugin_ipv6_enabled': value => $network_plugin_ipv6_enabled;
@ -200,10 +96,10 @@ class manila::network::neutron (
if $auth_type == 'password' {
manila_config {
'neutron/username': value => $username_real;
'neutron/username': value => $username;
'neutron/user_domain_name': value => $user_domain_name;
'neutron/password': value => $password_real, secret => true;
'neutron/project_name': value => $project_name_real;
'neutron/password': value => $password, secret => true;
'neutron/project_name': value => $project_name;
'neutron/project_domain_name': value => $project_domain_name;
}
}

View File

@ -0,0 +1,29 @@
---
deprecations:
- |
The following parameters in ``manila::compute::nova`` class have been
removed.
- ``nova_catalog_info``
- ``nova_catalog_admin_info``
- ``nova_api_insecure``
- ``nova_ca_certificates_file``
- ``nova_admin_username``
- ``nova_admin_password``
- ``nova_admin_tenant_name``
- ``nova_admin_auth_url``
- |
The following parameters in ``manila::network::neutron`` class have been
removed.
- ``neutron_api_insecure``
- ``neutron_ca_certificates_file``
- ``neutron_url``
- ``neutron_url_timeout``
- ``neutron_admin_username``
- ``neutron_admin_password``
- ``neutron_admin_tenant_name``
- ``neutron_region_name``
- ``neutron_admin_auth_url``
- ``neutron_auth_strategy``

View File

@ -48,28 +48,6 @@ describe 'manila::compute::nova' do
is_expected.to contain_manila_config('nova/password').with_value('123123').with_secret(true)
end
end
context 'with deprecated parameters' do
let :params do
{
:nova_api_insecure => true,
:nova_ca_certificates_file => '/foo/ssl/certs/ca.crt',
:auth_type => 'password',
:nova_admin_tenant_name => 'service2',
:nova_admin_username => 'novav2',
:nova_admin_password => '321321',
}
end
it 'configures manila compute nova with deprecated parameters' do
is_expected.to contain_manila_config('nova/auth_type').with_value('password')
is_expected.to contain_manila_config('nova/insecure').with_value(true)
is_expected.to contain_manila_config('nova/cafile').with_value('/foo/ssl/certs/ca.crt')
is_expected.to contain_manila_config('nova/project_name').with_value('service2')
is_expected.to contain_manila_config('nova/username').with_value('novav2')
is_expected.to contain_manila_config('nova/password').with_value('321321')
end
end
end
on_supported_os({

View File

@ -58,30 +58,6 @@ describe 'manila::network::neutron' do
is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv6_enabled').with_value(true)
end
end
context 'with deprecated parameters' do
let :params do
{
:auth_type => 'password',
:neutron_api_insecure => true,
:neutron_ca_certificates_file => '/foo/ssl/certs/ca.crt',
:neutron_admin_tenant_name => 'service2',
:neutron_admin_username => 'neutronv2',
:neutron_admin_password => '321321',
:neutron_url_timeout => 30,
}
end
it 'configures manila compute nova with deprecated parameters' do
is_expected.to contain_manila_config('neutron/auth_type').with_value('password')
is_expected.to contain_manila_config('neutron/insecure').with_value(true)
is_expected.to contain_manila_config('neutron/cafile').with_value('/foo/ssl/certs/ca.crt')
is_expected.to contain_manila_config('neutron/project_name').with_value('service2')
is_expected.to contain_manila_config('neutron/username').with_value('neutronv2')
is_expected.to contain_manila_config('neutron/password').with_value('321321').with_secret(true)
is_expected.to contain_manila_config('neutron/timeout').with_value(30)
end
end
end
on_supported_os({