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
This commit is contained in:
ZhongShengping 2017-10-12 09:42:15 +08:00
parent 968f052b90
commit 8b0783abb0

View File

@ -117,8 +117,16 @@ class trove::logging(
$use_syslog_real = pick($::trove::api::use_syslog, $use_syslog) $use_syslog_real = pick($::trove::api::use_syslog, $use_syslog)
$use_stderr_real = pick($::trove::api::use_stderr, $use_stderr) $use_stderr_real = pick($::trove::api::use_stderr, $use_stderr)
$log_facility_real = pick($::trove::api::log_facility, $log_facility) $log_facility_real = pick($::trove::api::log_facility, $log_facility)
$log_dir_real = pick($::trove::api::log_dir, $log_dir) if $log_dir != '' {
$log_file_real = pick($::trove::api::log_file, $log_file) $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) $debug_real = pick($::trove::api::debug, $debug)
oslo::log { 'trove_config': oslo::log { 'trove_config':