Add an ability to manage use_stderr parameter

When logging is already set up, it can be useful to disable this option
to avoid logs duplication (collected by Upstart, for example)

Change-Id: I1787191d9a512fdd3c3f79d6fadda110c5e41d54
Closes-bug: #1482564
(cherry picked from commit 1f4a545247)
This commit is contained in:
Sergey Kolekonov 2015-08-07 15:44:19 +03:00 committed by Michal Rostecki
parent f05abd2bd2
commit d1c47df349
4 changed files with 25 additions and 4 deletions

View File

@ -124,6 +124,10 @@
# (optional) Use syslog for logging.
# Defaults to false.
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to true
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -212,6 +216,7 @@ class glance::api(
$manage_service = true,
$enabled = true,
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$show_image_direct_url = false,
$purge_config = false,
@ -305,6 +310,7 @@ class glance::api(
glance_api_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/use_stderr': value => $use_stderr;
'DEFAULT/bind_host': value => $bind_host;
'DEFAULT/bind_port': value => $bind_port;
'DEFAULT/backlog': value => $backlog;

View File

@ -85,6 +85,10 @@
# (optional) Use syslog for logging.
# Defaults to false.
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to true
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to LOG_USER.
@ -142,6 +146,7 @@ class glance::registry(
$keystone_user = 'glance',
$pipeline = 'keystone',
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$manage_service = true,
$enabled = true,
@ -218,10 +223,11 @@ class glance::registry(
}
glance_registry_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/bind_host': value => $bind_host;
'DEFAULT/bind_port': value => $bind_port;
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/bind_host': value => $bind_host;
'DEFAULT/bind_port': value => $bind_port;
'DEFAULT/use_stderr': value => $use_stderr;
}
if $auth_uri {

View File

@ -13,6 +13,7 @@ describe 'glance::api' do
{
:verbose => false,
:debug => false,
:use_stderr => true,
:bind_host => '0.0.0.0',
:bind_port => '9292',
:registry_host => '0.0.0.0',
@ -96,6 +97,7 @@ describe 'glance::api' do
[
'verbose',
'debug',
'use_stderr',
'bind_host',
'bind_port',
'registry_host',

View File

@ -11,6 +11,7 @@ describe 'glance::registry' do
{
:verbose => false,
:debug => false,
:use_stderr => true,
:bind_host => '0.0.0.0',
:bind_port => '9191',
:log_file => '/var/log/glance/registry.log',
@ -285,6 +286,12 @@ describe 'glance::registry' do
it { should contain_glance_registry_config('DEFAULT/key_file').with_ensure('absent')}
end
describe 'with use_stderr enabled (default)' do
let(:params) { default_params }
it { should contain_glance_registry_config('DEFAULT/use_stderr').with_value('true')}
end
describe 'with ssl options' do
let :params do
default_params.merge({