From eb2b84ea8fd4513c00a1b38e6d7041e1d6d81a23 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 26 Aug 2022 15:10:59 +0900 Subject: [PATCH] Fix inconsistent parameter/resource names of wsgi::apache The barbican::wsgi::apache class names a few parameters and resources differently from the other modules. To make its interface and implementation consistent with the other implementations, this renames these inconsistent names. The old parameter names are kept but will be removed in a future release. Change-Id: I49ca51e4ea7a2404dfdbd0c88ce39339750da4f6 --- manifests/wsgi/apache.pp | 38 ++++++++++++++----- ...t-wsgi-apache-params-491fbe2bccfece96.yaml | 9 +++++ spec/classes/barbican_wsgi_apache_spec.rb | 16 ++++---- 3 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 403c52f7..8fd9fc56 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -13,16 +13,16 @@ # (Optional) The servername for the virtualhost. # Defaults to $::fqdn # -# [*public_port*] -# (Optional) The public port. +# [*port*] +# (Optional) The port. # Defaults to 9311 # # [*bind_host*] # (Optional) The host/ip address Apache will listen on. # Defaults to undef (listen on all ip addresses). # -# [*public_path*] -# (Optional) The prefix for the public endpoint. +# [*path*] +# (Optional) The prefix for the endpoint. # Defaults to '/' # # [*ssl*] @@ -106,6 +106,16 @@ # directives to be placed at the end of the vhost configuration. # Defaults to undef. # +# DEPRECATED PARAMETERS +# +# [*public_port*] +# (Optional) The public port. +# Defaults to undef +# +# [*public_path*] +# (Optional) The prefix for the public endpoint. +# Defaults to undef +# # == Authors # # Ade Lee @@ -116,9 +126,9 @@ # class barbican::wsgi::apache ( $servername = $::fqdn, - $public_port = 9311, + $port = 9311, $bind_host = undef, - $public_path = '/', + $path = '/', $ssl = false, $workers = $::os_workers, $ssl_cert = undef, @@ -142,6 +152,9 @@ class barbican::wsgi::apache ( $headers = undef, $request_headers = undef, $vhost_custom_fragment = undef, + # DEPRECATED PARAMETERS + $public_port = undef, + $public_path = undef ) { include barbican::deps @@ -149,11 +162,18 @@ class barbican::wsgi::apache ( Anchor['barbican::install::end'] -> Class['apache'] - openstacklib::wsgi::apache { 'barbican_wsgi_main': + if $public_port { + warning('The public_port parameter is deprecated. Use the port parameter') + } + if $public_path { + warning('The public_path parameter is deprecated. Use the path parameter') + } + + openstacklib::wsgi::apache { 'barbican_wsgi': bind_host => $bind_host, - bind_port => $public_port, + bind_port => pick($public_port, $port), group => $::barbican::params::group, - path => $public_path, + path => pick($public_path, $path), priority => $priority, servername => $servername, ssl => $ssl, diff --git a/releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml b/releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml new file mode 100644 index 00000000..cbafd4e1 --- /dev/null +++ b/releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml @@ -0,0 +1,9 @@ +--- +deprecations: + - | + The ``barbican::wsgi::apache::public_port`` parameter has been deprecated. + Use the ``port`` prameter instead. + + - | + The ``barbican::wsgi::apache::public_path`` parameter has been deprecated. + Use the ``path`` prameter instead. diff --git a/spec/classes/barbican_wsgi_apache_spec.rb b/spec/classes/barbican_wsgi_apache_spec.rb index 7f3e892c..5bdedad4 100644 --- a/spec/classes/barbican_wsgi_apache_spec.rb +++ b/spec/classes/barbican_wsgi_apache_spec.rb @@ -24,7 +24,7 @@ describe 'barbican::wsgi::apache' do shared_examples_for 'apache serving barbican with mod_wsgi' do context 'with default parameters' do it { is_expected.to contain_class('barbican::params') } - it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi').with( :bind_port => 9311, :group => 'barbican', :path => '/', @@ -57,7 +57,7 @@ describe 'barbican::wsgi::apache' do { :servername => 'dummy.host', :bind_host => '10.42.51.1', - :public_port => 12345, + :port => 12345, :ssl => true, :wsgi_process_display_name => 'barbican-api', :workers => 37, @@ -70,7 +70,7 @@ describe 'barbican::wsgi::apache' do } end it { is_expected.to contain_class('barbican::params') } - it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi').with( :bind_host => '10.42.51.1', :bind_port => 12345, :group => 'barbican', @@ -104,7 +104,7 @@ describe 'barbican::wsgi::apache' do } end - it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with( :access_log_format => params[:access_log_format], :access_log_syslog => params[:access_log_syslog], :error_log_syslog => params[:error_log_syslog], @@ -118,7 +118,7 @@ describe 'barbican::wsgi::apache' do } end - it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with( :access_log_file => params[:access_log_file], )} end @@ -130,7 +130,7 @@ describe 'barbican::wsgi::apache' do } end - it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with( :access_log_pipe => params[:access_log_pipe], )} end @@ -142,7 +142,7 @@ describe 'barbican::wsgi::apache' do } end - it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with( :error_log_file => params[:error_log_file], )} end @@ -154,7 +154,7 @@ describe 'barbican::wsgi::apache' do } end - it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with( + it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with( :error_log_pipe => params[:error_log_pipe], )} end