Browse Source

Merge "Allow wsgi script to be configurable"

tags/16.2.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
428cb0a266
3 changed files with 26 additions and 5 deletions
  1. +15
    -2
      manifests/wsgi/apache.pp
  2. +6
    -0
      releasenotes/notes/add-wsgi-script-args-24942cd8c143ed08.yaml
  3. +5
    -3
      spec/classes/aodh_wsgi_apache_spec.rb

+ 15
- 2
manifests/wsgi/apache.pp View File

@@ -90,6 +90,14 @@
# { python-path => '/my/python/virtualenv' }
# Defaults to {}
#
# [*wsgi_script_dir*]
# (optional) The directory to install the WSGI script for apache to read
# Optional. Defaults to $::aodh::params::aodh_wsgi_script_path
#
# [*wsgi_script_source*]
# (optional) The location of the aodh WSGI script
# Optional. Defaults to $::aodh::params::aodh_wsgi_script_source
#
#
# == Dependencies
#
@@ -122,6 +130,8 @@ class aodh::wsgi::apache (
$access_log_format = false,
$error_log_file = undef,
$custom_wsgi_process_options = {},
$wsgi_script_dir = undef,
$wsgi_script_source = undef,
) {

include aodh::deps
@@ -132,6 +142,9 @@ class aodh::wsgi::apache (
include apache::mod::ssl
}

$wsgi_script_dir_real = pick($wsgi_script_dir, $::aodh::params::aodh_wsgi_script_path)
$wsgi_script_source_real = pick($wsgi_script_source, $::aodh::params::aodh_wsgi_script_source)

# NOTE(aschultz): needed because the packaging may introduce some apache
# configuration files that apache may remove. See LP#1657847
Anchor['aodh::install::end'] -> Class['apache']
@@ -157,9 +170,9 @@ class aodh::wsgi::apache (
wsgi_daemon_process => 'aodh',
wsgi_process_display_name => $wsgi_process_display_name,
wsgi_process_group => 'aodh',
wsgi_script_dir => $::aodh::params::aodh_wsgi_script_path,
wsgi_script_dir => $wsgi_script_dir_real,
wsgi_script_file => 'app',
wsgi_script_source => $::aodh::params::aodh_wsgi_script_source,
wsgi_script_source => $wsgi_script_source_real,
custom_wsgi_process_options => $custom_wsgi_process_options,
access_log_file => $access_log_file,
access_log_format => $access_log_format,


+ 6
- 0
releasenotes/notes/add-wsgi-script-args-24942cd8c143ed08.yaml View File

@@ -0,0 +1,6 @@
---
features:
- |
It is now possible to specify `aodh::wsgi::apache::wsgi_script_dir`
and `aodh::wsgi::apache::wsgi_script_source` to override operating
system defaults.

+ 5
- 3
spec/classes/aodh_wsgi_apache_spec.rb View File

@@ -42,7 +42,9 @@ describe 'aodh::wsgi::apache' do
},
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log'
:error_log_file => '/var/log/httpd/error_log',
:wsgi_script_dir => '/var/lib/openstack/cgi-bin/aodh',
:wsgi_script_source => '/my/path/app.wsgi'
}
end
it { is_expected.to contain_class('aodh::params') }
@@ -62,9 +64,9 @@ describe 'aodh::wsgi::apache' do
:wsgi_daemon_process => 'aodh',
:wsgi_process_display_name => 'aodh',
:wsgi_process_group => 'aodh',
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_dir => '/var/lib/openstack/cgi-bin/aodh',
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:wsgi_script_source => '/my/path/app.wsgi',
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},


Loading…
Cancel
Save