Use consistent path pattern for lock_path

Update the default lock_path value following the patten used in
a few other moduels (cinder, glance, manila and nova).

Change-Id: I97bbae12be921a6ab81a7ebcdea74d580d29f259
This commit is contained in:
Takashi Kajinami 2024-09-16 00:27:54 +09:00
parent 38d49a4b6e
commit 1ad35d2790
3 changed files with 10 additions and 7 deletions

View File

@ -240,7 +240,7 @@
# [*lock_path*] # [*lock_path*]
# (optional) Where to store lock files. This directory must be writeable # (optional) Where to store lock files. This directory must be writeable
# by the user executing the agent # by the user executing the agent
# Defaults to: '$state_path/lock' # Defaults to: $::neutron::params::lock_path
# #
# [*purge_config*] # [*purge_config*]
# (optional) Whether to set only the specified config options # (optional) Whether to set only the specified config options
@ -320,17 +320,16 @@ class neutron (
$key_file = $facts['os_service_default'], $key_file = $facts['os_service_default'],
$ca_file = $facts['os_service_default'], $ca_file = $facts['os_service_default'],
$state_path = $facts['os_service_default'], $state_path = $facts['os_service_default'],
$lock_path = '$state_path/lock', $lock_path = $::neutron::params::lock_path,
Boolean $purge_config = false, Boolean $purge_config = false,
$notification_driver = $facts['os_service_default'], $notification_driver = $facts['os_service_default'],
$notification_topics = $facts['os_service_default'], $notification_topics = $facts['os_service_default'],
$notification_transport_url = $facts['os_service_default'], $notification_transport_url = $facts['os_service_default'],
$max_allowed_address_pair = $facts['os_service_default'], $max_allowed_address_pair = $facts['os_service_default'],
$vlan_transparent = $facts['os_service_default'], $vlan_transparent = $facts['os_service_default'],
) { ) inherits neutron::params {
include neutron::deps include neutron::deps
include neutron::params
if ! is_service_default($use_ssl) and ($use_ssl) { if ! is_service_default($use_ssl) and ($use_ssl) {
if is_service_default($cert_file) { if is_service_default($cert_file) {

View File

@ -25,6 +25,7 @@ class neutron::params {
case $facts['os']['family'] { case $facts['os']['family'] {
'RedHat': { 'RedHat': {
$lock_path = '/var/lib/neutron/tmp'
$package_name = 'openstack-neutron' $package_name = 'openstack-neutron'
$server_service = 'neutron-server' $server_service = 'neutron-server'
$server_package = undef $server_package = undef
@ -68,6 +69,7 @@ class neutron::params {
$networking_baremetal_agent_service = 'ironic-neutron-agent' $networking_baremetal_agent_service = 'ironic-neutron-agent'
} }
'Debian': { 'Debian': {
$lock_path = '/var/lock/neutron'
$package_name = 'neutron-common' $package_name = 'neutron-common'
if $facts['os']['name'] == 'Debian' { if $facts['os']['name'] == 'Debian' {
$ml2_server_package = undef $ml2_server_package = undef

View File

@ -114,7 +114,7 @@ describe 'neutron' do
should contain_neutron_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>') should contain_neutron_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('DEFAULT/state_path').with_value('<SERVICE DEFAULT>') should contain_neutron_config('DEFAULT/state_path').with_value('<SERVICE DEFAULT>')
should contain_oslo__concurrency('neutron_config').with( should contain_oslo__concurrency('neutron_config').with(
:lock_path => '$state_path/lock' :lock_path => platform_params[:lock_path]
) )
should contain_oslo__messaging__default('neutron_config').with( should contain_oslo__messaging__default('neutron_config').with(
:executor_thread_pool_size => '<SERVICE DEFAULT>', :executor_thread_pool_size => '<SERVICE DEFAULT>',
@ -445,11 +445,13 @@ describe 'neutron' do
case facts[:os]['family'] case facts[:os]['family']
when 'Debian' when 'Debian'
{ {
:common_package_name => 'neutron-common' :common_package_name => 'neutron-common',
:lock_path => '/var/lock/neutron'
} }
when 'RedHat' when 'RedHat'
{ {
:common_package_name => 'openstack-neutron' :common_package_name => 'openstack-neutron',
:lock_path => '/var/lib/neutron/tmp'
} }
end end
end end