Merge "Add log_dir param. by default and allow users to disable it"
This commit is contained in:
commit
e4fccb9e02
@ -12,7 +12,12 @@
|
|||||||
# [log_facility]
|
# [log_facility]
|
||||||
# Syslog facility to receive log lines.
|
# Syslog facility to receive log lines.
|
||||||
# (Optional) Defaults to LOG_USER.
|
# (Optional) Defaults to LOG_USER.
|
||||||
|
#
|
||||||
|
# [*log_dir*]
|
||||||
|
# (optional) Directory where logs should be stored.
|
||||||
|
# If set to boolean false, it will not log to any directory.
|
||||||
|
# Defaults to '/var/log/cinder'
|
||||||
|
#
|
||||||
class cinder (
|
class cinder (
|
||||||
$sql_connection,
|
$sql_connection,
|
||||||
$sql_idle_timeout = '3600',
|
$sql_idle_timeout = '3600',
|
||||||
@ -42,6 +47,7 @@ class cinder (
|
|||||||
$api_paste_config = '/etc/cinder/api-paste.ini',
|
$api_paste_config = '/etc/cinder/api-paste.ini',
|
||||||
$use_syslog = false,
|
$use_syslog = false,
|
||||||
$log_facility = 'LOG_USER',
|
$log_facility = 'LOG_USER',
|
||||||
|
$log_dir = '/var/log/cinder',
|
||||||
$verbose = false,
|
$verbose = false,
|
||||||
$debug = false
|
$debug = false
|
||||||
) {
|
) {
|
||||||
@ -147,6 +153,16 @@ class cinder (
|
|||||||
'DEFAULT/rpc_backend': value => $rpc_backend;
|
'DEFAULT/rpc_backend': value => $rpc_backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $log_dir {
|
||||||
|
cinder_config {
|
||||||
|
'DEFAULT/log_dir': value => $log_dir;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cinder_config {
|
||||||
|
'DEFAULT/log_dir': ensure => absent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if $use_syslog {
|
if $use_syslog {
|
||||||
cinder_config {
|
cinder_config {
|
||||||
'DEFAULT/use_syslog': value => true;
|
'DEFAULT/use_syslog': value => true;
|
||||||
|
@ -60,6 +60,7 @@ describe 'cinder' do
|
|||||||
should contain_cinder_config('DEFAULT/api_paste_config').with(
|
should contain_cinder_config('DEFAULT/api_paste_config').with(
|
||||||
:value => '/etc/cinder/api-paste.ini'
|
:value => '/etc/cinder/api-paste.ini'
|
||||||
)
|
)
|
||||||
|
should contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log/cinder')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_file('/etc/cinder/cinder.conf').with(
|
it { should contain_file('/etc/cinder/cinder.conf').with(
|
||||||
@ -207,4 +208,9 @@ describe 'cinder' do
|
|||||||
it { should contain_cinder_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') }
|
it { should contain_cinder_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'with log_dir disabled' do
|
||||||
|
let(:params) { req_params.merge!({:log_dir => false}) }
|
||||||
|
it { should contain_cinder_config('DEFAULT/log_dir').with_ensure('absent') }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user