From a4f6673a021c2882d4af8b71a20cfa4d2552f57a Mon Sep 17 00:00:00 2001 From: Matthias Bastian Date: Fri, 6 Jul 2018 12:22:44 +0200 Subject: [PATCH] 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 --- manifests/auth.pp | 18 ++++++++++++++++-- ...dpoint_type-parameter-405533a1bbb2fa2a.yaml | 8 ++++++++ spec/classes/aodh_auth_spec.rb | 6 +++--- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/deprecate-auth_endpoint_type-parameter-405533a1bbb2fa2a.yaml diff --git a/manifests/auth.pp b/manifests/auth.pp index 62683b44..fd3452f0 100644 --- a/manifests/auth.pp +++ b/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; diff --git a/releasenotes/notes/deprecate-auth_endpoint_type-parameter-405533a1bbb2fa2a.yaml b/releasenotes/notes/deprecate-auth_endpoint_type-parameter-405533a1bbb2fa2a.yaml new file mode 100644 index 00000000..e466136a --- /dev/null +++ b/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. diff --git a/spec/classes/aodh_auth_spec.rb b/spec/classes/aodh_auth_spec.rb index 4ef2d3fa..4b8e7f39 100644 --- a/spec/classes/aodh_auth_spec.rb +++ b/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