From 74a6f0a852912afc5d9cc6930aeeadd4fbf43d43 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 20 Mar 2014 00:08:19 +0100 Subject: [PATCH] if log_file enabled, ensure log_dir is not absent If log_file is specified, that means we should configure log_dir. Otherwise, when running a command which use debug (like db-sync commands), it will try to write logs in the user directory which is not the best way. This patch aims to ensure that we configure log_dir instead of remove the flag like it was before. Partial-bug #1292619 Signed-off-by: Emilien Macchi Change-Id: I94528b42a4865976f74d264facd91cb521c177bd --- manifests/init.pp | 4 ++-- spec/classes/neutron_init_spec.rb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 84a6a7258..6ce230451 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -220,8 +220,8 @@ if $log_file { neutron_config { - 'DEFAULT/log_file': value => $log_file; - 'DEFAULT/log_dir': ensure => absent; + 'DEFAULT/log_file': value => $log_file; + 'DEFAULT/log_dir': value => $log_dir; } } else { if $log_dir { diff --git a/spec/classes/neutron_init_spec.rb b/spec/classes/neutron_init_spec.rb index a7680cde4..a4fdaf09f 100644 --- a/spec/classes/neutron_init_spec.rb +++ b/spec/classes/neutron_init_spec.rb @@ -164,12 +164,13 @@ shared_examples_for 'with log_file specified' do before do params.merge!( - :log_file => '/var/log/neutron/server.log' + :log_file => '/var/log/neutron/server.log', + :log_dir => '/tmp/log/neutron' ) end it 'configures logging' do should contain_neutron_config('DEFAULT/log_file').with_value(params[:log_file]) - should contain_neutron_config('DEFAULT/log_dir').with_ensure('absent') + should contain_neutron_config('DEFAULT/log_dir').with_value(params[:log_dir]) end end