Add param for controlling which nova endpoint is used

This patch adds the 'neutron::notifications::endpoint_type' parameter
to allow controlling which endpoint from the keystone catalog is used
when communicating with nova.

Change-Id: I4d17fb08634c3da3ac59a7c1fe728657e4da2c3f
Partial-Bug: #1745002
This commit is contained in:
Brent Eagles 2018-01-23 15:58:55 -03:30
parent 7428f6848a
commit ae730fb95b
3 changed files with 15 additions and 0 deletions

View File

@ -81,6 +81,11 @@
# one region.
# Defaults to $::os_service_default
#
# [*endpoint_type*]
# (optional) The type of nova endpoint to use when looking up in
# the keystone catalog.
# Defaults to $::os_service_default
#
# === Deprecated Parameters
#
# [*auth_plugin*]
@ -105,6 +110,7 @@ class neutron::server::notifications (
$user_domain_name = 'Default',
$auth_url = 'http://127.0.0.1:35357',
$region_name = $::os_service_default,
$endpoint_type = $::os_service_default,
# DEPRECATED PARAMETERS
$auth_plugin = $::os_service_default,
) {
@ -125,6 +131,7 @@ class neutron::server::notifications (
'nova/user_domain_id': value => $user_domain_id;
'nova/user_domain_name': value => $user_domain_name;
'nova/region_name': value => $region_name;
'nova/endpoint_type': value => $endpoint_type;
}
if ! is_service_default ($auth_plugin) and ($auth_plugin) {
warning('auth_plugin parameter is deprecated, auth_type should be used instead')

View File

@ -0,0 +1,5 @@
---
features:
- |
Added a new parameter 'neutron::notifications::endpoint_type' for specifying
the endpoint type when getting a nova endpoint from the keystone catalog.

View File

@ -57,6 +57,7 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('nova/project_domain_name').with_value('Default')
is_expected.to contain_neutron_config('nova/user_domain_id').with_value('default')
is_expected.to contain_neutron_config('nova/user_domain_name').with_value('Default')
is_expected.to contain_neutron_config('nova/endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.not_to contain_neutron_config('nova/auth_plugin')
end
@ -75,6 +76,7 @@ describe 'neutron::server::notifications' do
:project_domain_name => 'Default_2',
:user_domain_id => 'default_3',
:user_domain_name => 'Default_4',
:endpoint_type => 'internal'
)
end
it 'should configure neutron server with overrided parameters' do
@ -92,6 +94,7 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('nova/project_domain_name').with_value('Default_2')
is_expected.to contain_neutron_config('nova/user_domain_id').with_value('default_3')
is_expected.to contain_neutron_config('nova/user_domain_name').with_value('Default_4')
is_expected.to contain_neutron_config('nova/endpoint_type').with_value('internal')
end
end