Remove os_region_name and deprecate os_interface

The placement options os_region_name and os_interface
is removed as of Rocky [1].

This removes the already deprecated os_region_name parameter
and users should use the region_name parameter instead.

It also deprecates the os_interface parameter and users should
use the valid_interfaces parameter instead. The configuration file is
changed so that the placement/valid_interfaces option is set instead
of os_interface since that one does not have any effect.

[1] https://docs.openstack.org/releasenotes/nova/rocky.html

Change-Id: I13201f8edf5d0ef87c6a4d90d3726ae7f1c2c300
This commit is contained in:
Tobias Urdin 2018-09-25 15:17:35 +02:00
parent 37f69d92e3
commit b1181f6242
3 changed files with 25 additions and 17 deletions

View File

@ -54,9 +54,9 @@
# through the OpenStack Identity service.
# Defaults to 'RegionOne'
#
# [*os_interface*]
# (optional) interface name used for getting the keystone endpoint for
# the placement API.
# [*valid_interfaces*]
# (optional) Interface names used for getting the keystone endpoint for
# the placement API. Comma separated if multiple.
# Defaults to $::os_service_default
#
# [*username*]
@ -72,9 +72,9 @@
#
# DEPRECATED PARAMETERS
#
# [*os_region_name*]
# (optional) Region name for connecting to Nova Placement API service in admin context
# through the OpenStack Identity service.
# [*os_interface*]
# (optional) interface name used for getting the keystone endpoint for
# the placement API.
# Defaults to undef
#
class nova::placement(
@ -87,24 +87,23 @@ class nova::placement(
$auth_type = 'password',
$auth_url = 'http://127.0.0.1:5000/v3',
$region_name = 'RegionOne',
$os_interface = $::os_service_default,
$valid_interfaces = $::os_service_default,
$project_domain_name = 'Default',
$project_name = 'services',
$user_domain_name = 'Default',
$username = 'placement',
# DEPRECATED PARAMETERS
$os_region_name = undef,
$os_interface = undef,
) inherits nova::params {
include ::nova::deps
validate_bool($enabled)
if $os_region_name {
warning('The os_region_name parameter is deprecated and will be removed \
in a future release. Please use region_name instead.')
if $os_interface {
warning('nova::placement::os_interface is deprecated for removal, please use valid_interfaces instead.')
}
$region_name_real = pick($os_region_name, $region_name)
$valid_interfaces_real = pick($os_interface, $valid_interfaces)
if $service_name == 'nova-placement-api' {
nova::generic_service { 'nova-placement-api':
@ -129,8 +128,8 @@ in a future release. Please use region_name instead.')
'placement/project_name': value => $project_name;
'placement/user_domain_name': value => $user_domain_name;
'placement/username': value => $username;
'placement/region_name': value => $region_name_real;
'placement/os_interface': value => $os_interface;
'placement/region_name': value => $region_name;
'placement/valid_interfaces': value => $valid_interfaces_real;
}
}

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The deprecated nova::placement::os_region_name parameter is now removed.
Please use the nova::placement::region_name parameter instead.
deprecations:
- |
The nova::placement::os_interface parameter is now deprecated and will be
removed the next release. Please use nova::placement::valid_interfaces instead.

View File

@ -26,7 +26,7 @@ describe 'nova::placement' do
is_expected.to contain_nova_config('placement/project_name').with_value(default_params[:project_name])
is_expected.to contain_nova_config('placement/project_domain_name').with_value(default_params[:project_domain_name])
is_expected.to contain_nova_config('placement/region_name').with_value(default_params[:region_name])
is_expected.to contain_nova_config('placement/os_interface').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('placement/valid_interfaces').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('placement/username').with_value(default_params[:username])
is_expected.to contain_nova_config('placement/user_domain_name').with_value(default_params[:user_domain_name])
is_expected.to contain_nova_config('placement/auth_url').with_value(default_params[:auth_url])
@ -40,7 +40,7 @@ describe 'nova::placement' do
:project_name => 'service',
:project_domain_name => 'default',
:region_name => 'RegionTwo',
:os_interface => 'internal',
:valid_interfaces => 'internal',
:username => 'placement2',
:user_domain_name => 'default',
:auth_url => 'https://127.0.0.1:5000/v3',
@ -53,7 +53,7 @@ describe 'nova::placement' do
is_expected.to contain_nova_config('placement/project_name').with_value(params[:project_name])
is_expected.to contain_nova_config('placement/project_domain_name').with_value(params[:project_domain_name])
is_expected.to contain_nova_config('placement/region_name').with_value(params[:region_name])
is_expected.to contain_nova_config('placement/os_interface').with_value(params[:os_interface])
is_expected.to contain_nova_config('placement/valid_interfaces').with_value(params[:valid_interfaces])
is_expected.to contain_nova_config('placement/username').with_value(params[:username])
is_expected.to contain_nova_config('placement/user_domain_name').with_value(params[:user_domain_name])
is_expected.to contain_nova_config('placement/auth_url').with_value(params[:auth_url])