From 8b0783abb0f0d7ddec2ba610cd8e8d54eb190c14 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 12 Oct 2017 09:42:15 +0800 Subject: [PATCH] Accept empty strings for log_dir and log_file An empty string is an acceptable value of this entry, and it forces logging to stdout/stderr, which is useful when running on containers. Change-Id: I363a7558e4addf6b984e27bfa19ebec6d13aa01d --- manifests/logging.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/manifests/logging.pp b/manifests/logging.pp index 9e7231b0..2d96b3c8 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -117,8 +117,16 @@ class trove::logging( $use_syslog_real = pick($::trove::api::use_syslog, $use_syslog) $use_stderr_real = pick($::trove::api::use_stderr, $use_stderr) $log_facility_real = pick($::trove::api::log_facility, $log_facility) - $log_dir_real = pick($::trove::api::log_dir, $log_dir) - $log_file_real = pick($::trove::api::log_file, $log_file) + if $log_dir != '' { + $log_dir_real = pick($::trove::api::log_dir,$log_dir) + } else { + $log_dir_real = $log_dir + } + if $log_file != '' { + $log_file_real = pick($::trove::api::log_file,$log_file) + } else { + $log_file_real = $log_file + } $debug_real = pick($::trove::api::debug, $debug) oslo::log { 'trove_config':