From 99b185c66f8747ef48b2963188cdcbcaca39774a Mon Sep 17 00:00:00 2001 From: Clayton O'Neill Date: Tue, 4 Aug 2015 14:53:16 -0400 Subject: [PATCH] Fix "Add lock_path to cinder config" Amend Ia94b17e24ec179a1804bc78c8defc25d63f7a4d3 to be distro agnostic. Change-Id: Ib94ebf2fd8e70001ad154460dc829d2f52bd1dce Closes-Bug: #1482590 --- manifests/init.pp | 4 ++-- manifests/params.pp | 2 ++ spec/classes/cinder_spec.rb | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 72fb3cde..c3439b17 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -228,7 +228,7 @@ # [*lock_path*] # (optional) Where to store lock files. This directory must be writeable # by the user executing the agent -# Defaults to: /var/lock/cinder +# Defaults to: $::cinder::params::lock_path # # === Deprecated Parameters # @@ -289,7 +289,7 @@ class cinder ( $default_availability_zone = false, $enable_v1_api = true, $enable_v2_api = true, - $lock_path = '/var/lock/cinder', + $lock_path = $::cinder::params::lock_path, # DEPRECATED PARAMETERS $mysql_module = undef, ) { diff --git a/manifests/params.pp b/manifests/params.pp index 6ee7dd99..1052352b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,6 +19,7 @@ class cinder::params { $ceph_init_override = '/etc/init/cinder-volume.override' $iscsi_helper = 'tgtadm' $lio_package_name = 'targetcli' + $lock_path = '/var/lock/cinder' } elsif($::osfamily == 'RedHat') { @@ -37,6 +38,7 @@ class cinder::params { $tgt_service_name = 'tgtd' $ceph_init_override = '/etc/sysconfig/openstack-cinder-volume' $lio_package_name = 'targetcli' + $lock_path = '/var/lib/cinder/tmp' case $::operatingsystem { 'RedHat', 'CentOS', 'Scientific', 'OracleLinux': { diff --git a/spec/classes/cinder_spec.rb b/spec/classes/cinder_spec.rb index b565a2b9..4f2af376 100644 --- a/spec/classes/cinder_spec.rb +++ b/spec/classes/cinder_spec.rb @@ -1,7 +1,11 @@ require 'spec_helper' describe 'cinder' do let :req_params do - {:rabbit_password => 'guest', :database_connection => 'mysql://user:password@host/database'} + { + :rabbit_password => 'guest', + :database_connection => 'mysql://user:password@host/database', + :lock_path => '/var/lock/cinder', + } end let :facts do