Browse Source

Fix explicit endpoint configuration

When trying to specify the endpoint type in the identity service catalog
to use for communication with OpenStack services an outdated
configuration option was written: endpoint_type was replaced by
interface in aodh.

This change therefore also deprecates the aodh::auth::auth_endpoint_type
parameter in favor of a new aodh::auth::interface parameter.

Change-Id: Ifca3ddc47e02752dcf8503e5691005382bb6073c
changes/22/580622/1
Matthias Bastian 4 years ago
parent
commit
a4f6673a02
  1. 18
      manifests/auth.pp
  2. 8
      releasenotes/notes/deprecate-auth_endpoint_type-parameter-405533a1bbb2fa2a.yaml
  3. 6
      spec/classes/aodh_auth_spec.rb

18
manifests/auth.pp

@ -42,6 +42,13 @@
# Certificate chain for SSL validation.
# Optional. Defaults to $::os_service_default
#
# [*interface*]
# Type of endpoint in Identity service catalog to use for
# communication with OpenStack services.
# Optional. Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*auth_endpoint_type*]
# Type of endpoint in Identity service catalog to use for
# communication with OpenStack services.
@ -58,11 +65,18 @@ class aodh::auth (
$auth_type = 'password',
$auth_tenant_id = $::os_service_default,
$auth_cacert = $::os_service_default,
$auth_endpoint_type = $::os_service_default,
$interface = $::os_service_default,
# DEPRECATED PARAMETERS
$auth_endpoint_type = undef,
) {
include ::aodh::deps
if $auth_endpoint_type {
warning('The auth_endpoint_type parameter is deprecated. Please use interface instead.')
}
$interface_real = pick($auth_endpoint_type, $interface)
aodh_config {
'service_credentials/auth_url' : value => $auth_url;
'service_credentials/region_name' : value => $auth_region;
@ -71,7 +85,7 @@ class aodh::auth (
'service_credentials/project_name' : value => $auth_tenant_name;
'service_credentials/cacert' : value => $auth_cacert;
'service_credentials/tenant_id' : value => $auth_tenant_id;
'service_credentials/endpoint_type' : value => $auth_endpoint_type;
'service_credentials/interface' : value => $interface_real;
'service_credentials/project_domain_id' : value => $project_domain_id;
'service_credentials/user_domain_id' : value => $user_domain_id;
'service_credentials/auth_type' : value => $auth_type;

8
releasenotes/notes/deprecate-auth_endpoint_type-parameter-405533a1bbb2fa2a.yaml

@ -0,0 +1,8 @@
---
fixes:
- When trying to specify the endpoint type in the identity service catalog to
use for communication with OpenStack services an outdated configuration
option was written.
deprecations:
- aodh::auth::auth_endpoint_type is deprecated and will be removed in a future
release. Please use aodh::auth::interface instead.

6
spec/classes/aodh_auth_spec.rb

@ -28,12 +28,12 @@ describe 'aodh::auth' do
context 'when overriding parameters' do
before do
params.merge!(
:auth_cacert => '/tmp/dummy.pem',
:auth_endpoint_type => 'internalURL',
:auth_cacert => '/tmp/dummy.pem',
:interface => 'internalURL',
)
end
it { is_expected.to contain_aodh_config('service_credentials/cacert').with_value(params[:auth_cacert]) }
it { is_expected.to contain_aodh_config('service_credentials/endpoint_type').with_value(params[:auth_endpoint_type]) }
it { is_expected.to contain_aodh_config('service_credentials/interface').with_value(params[:interface]) }
end
end

Loading…
Cancel
Save