Merge "Remove os_region_name and deprecate os_interface"

This commit is contained in:
Zuul 2018-10-03 21:57:27 +00:00 committed by Gerrit Code Review
commit 50a2c96a65
3 changed files with 25 additions and 17 deletions

View File

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