Fix inconsistent parameter name of wsgi::apache

The nova::wsgi::apache class takes the api_port parameter to determine
the TCP port number, but this name is not commonly used while the port
parameter is used in the other modules. This change fixes the parameter
name so that we can keep the implementation more consistent.

Change-Id: I9d533275d5999fa02b438be1642f61b40a246161
This commit is contained in:
Takashi Kajinami
2023-01-23 10:32:15 +09:00
parent 2e0276d348
commit a258d3d8c7
5 changed files with 37 additions and 8 deletions

View File

@@ -28,7 +28,7 @@
# (Optional) The servername for the virtualhost.
# Defaults to $::fqdn
#
# [*api_port*]
# [*port*]
# (Optional) The port for Nova API service.
# Defaults to 8774
#
@@ -121,6 +121,12 @@
# directives to be placed at the end of the vhost configuration.
# Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*api_port*]
# (Optional) The port for Nova API service.
# Defaults to 8774
#
# == Dependencies
#
# requires Class['apache'] & Class['nova'] & Class['nova::api']
@@ -133,7 +139,7 @@
#
class nova::wsgi::apache_api (
$servername = $::fqdn,
$api_port = 8774,
$port = 8774,
$bind_host = undef,
$path = '/',
$ssl = false,
@@ -159,6 +165,8 @@ class nova::wsgi::apache_api (
$headers = undef,
$request_headers = undef,
$vhost_custom_fragment = undef,
# DEPRECATED PARAMETERS
$api_port = undef,
) {
include nova::params
@@ -167,9 +175,13 @@ class nova::wsgi::apache_api (
fail('::nova::api class must be declared in composition layer.')
}
if $api_port {
warning('The api_port parameter is deprecated. Use the port parameter')
}
::openstacklib::wsgi::apache { 'nova_api_wsgi':
bind_host => $bind_host,
bind_port => $api_port,
bind_port => pick($api_port, $port),
group => $::nova::params::group,
path => $path,
priority => $priority,

View File

@@ -32,7 +32,7 @@
# resource.
# Defaults to 'present'
#
# [*api_port*]
# [*port*]
# (Optional) The port for Nova API service.
# Defaults to 8775
#
@@ -125,6 +125,12 @@
# directives to be placed at the end of the vhost configuration.
# Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*api_port*]
# (Optional) The port for Nova API service.
# Defaults to 8775
#
# == Dependencies
#
# requires Class['apache'] & Class['nova'] & Class['nova::metadata']
@@ -137,7 +143,7 @@
#
class nova::wsgi::apache_metadata (
$servername = $::fqdn,
$api_port = 8775,
$port = 8775,
$bind_host = undef,
$path = '/',
$ssl = false,
@@ -164,6 +170,8 @@ class nova::wsgi::apache_metadata (
$headers = undef,
$request_headers = undef,
$vhost_custom_fragment = undef,
# DEPRECATED PARAMETERS
$api_port = undef,
) {
include nova::params
@@ -180,9 +188,13 @@ class nova::wsgi::apache_metadata (
Service <| title == 'httpd' |> { tag +> 'nova-service' }
if $api_port {
warning('The api_port parameter is deprecated. Use the port parameter')
}
::openstacklib::wsgi::apache { 'nova_metadata_wsgi':
bind_host => $bind_host,
bind_port => $api_port,
bind_port => pick($api_port, $port),
group => $::nova::params::group,
path => $path,
priority => $priority,

View File

@@ -0,0 +1,5 @@
---
deprecations:
- |
The ``nova::wsgi::apache::api_port`` parameter has been deprecated.
Use the ``port`` parameter instead.

View File

@@ -57,7 +57,7 @@ describe 'nova::wsgi::apache_api' do
{
:servername => 'dummy.host',
:bind_host => '10.42.51.1',
:api_port => 12345,
:port => 12345,
:ssl => true,
:vhost_custom_fragment => 'Timeout 99',
:wsgi_process_display_name => 'nova-api',

View File

@@ -53,7 +53,7 @@ describe 'nova::wsgi::apache_metadata' do
{
:servername => 'dummy.host',
:bind_host => '10.42.51.1',
:api_port => 12345,
:port => 12345,
:ssl => true,
:vhost_custom_fragment => 'Timeout 99',
:wsgi_process_display_name => 'nova-metadata',