From 1ad35d2790f17f293463131d137f963475733613 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 16 Sep 2024 00:27:54 +0900 Subject: [PATCH] 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 --- manifests/init.pp | 7 +++---- manifests/params.pp | 2 ++ spec/classes/neutron_init_spec.rb | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 37941be0d..2378a1eb5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -240,7 +240,7 @@ # [*lock_path*] # (optional) Where to store lock files. This directory must be writeable # by the user executing the agent -# Defaults to: '$state_path/lock' +# Defaults to: $::neutron::params::lock_path # # [*purge_config*] # (optional) Whether to set only the specified config options @@ -320,17 +320,16 @@ class neutron ( $key_file = $facts['os_service_default'], $ca_file = $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, $notification_driver = $facts['os_service_default'], $notification_topics = $facts['os_service_default'], $notification_transport_url = $facts['os_service_default'], $max_allowed_address_pair = $facts['os_service_default'], $vlan_transparent = $facts['os_service_default'], -) { +) inherits neutron::params { include neutron::deps - include neutron::params if ! is_service_default($use_ssl) and ($use_ssl) { if is_service_default($cert_file) { diff --git a/manifests/params.pp b/manifests/params.pp index 8b3dbc2be..79823c9b4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -25,6 +25,7 @@ class neutron::params { case $facts['os']['family'] { 'RedHat': { + $lock_path = '/var/lib/neutron/tmp' $package_name = 'openstack-neutron' $server_service = 'neutron-server' $server_package = undef @@ -68,6 +69,7 @@ class neutron::params { $networking_baremetal_agent_service = 'ironic-neutron-agent' } 'Debian': { + $lock_path = '/var/lock/neutron' $package_name = 'neutron-common' if $facts['os']['name'] == 'Debian' { $ml2_server_package = undef diff --git a/spec/classes/neutron_init_spec.rb b/spec/classes/neutron_init_spec.rb index e6f96a7e3..4e2d8de34 100644 --- a/spec/classes/neutron_init_spec.rb +++ b/spec/classes/neutron_init_spec.rb @@ -114,7 +114,7 @@ describe 'neutron' do should contain_neutron_config('DEFAULT/control_exchange').with_value('') should contain_neutron_config('DEFAULT/state_path').with_value('') 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( :executor_thread_pool_size => '', @@ -445,11 +445,13 @@ describe 'neutron' do case facts[:os]['family'] when 'Debian' { - :common_package_name => 'neutron-common' + :common_package_name => 'neutron-common', + :lock_path => '/var/lock/neutron' } when 'RedHat' { - :common_package_name => 'openstack-neutron' + :common_package_name => 'openstack-neutron', + :lock_path => '/var/lib/neutron/tmp' } end end