Merge "Use oslo module for logging"

This commit is contained in:
Jenkins 2016-05-13 20:59:35 +00:00 committed by Gerrit Code Review
commit 25ed088b87
6 changed files with 51 additions and 117 deletions

View File

@ -66,12 +66,12 @@ class trove::conductor(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$verbose = false,
$debug = false,
$verbose = $::os_service_default,
$debug = $::os_service_default,
$log_file = '/var/log/trove/trove-conductor.log',
$log_dir = '/var/log/trove',
$use_syslog = false,
$log_facility = 'LOG_USER',
$use_syslog = $::os_service_default,
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$conductor_manager = 'trove.conductor.manager.Manager',
$workers = $::processorcount,
@ -101,8 +101,6 @@ class trove::conductor(
# basic service config
trove_conductor_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/trove_auth_url': value => $auth_url;
'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
@ -144,37 +142,13 @@ class trove::conductor(
}
}
# Logging
if $log_file {
trove_conductor_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_conductor_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_conductor_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_conductor_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_conductor_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_conductor_config {
'DEFAULT/use_syslog': value => false;
}
oslo::log { 'trove_conductor_config':
debug => $debug,
verbose => $verbose,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}
trove::generic_service { 'conductor':

View File

@ -80,12 +80,12 @@ class trove::guestagent(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$verbose = false,
$debug = false,
$verbose = $::os_service_default,
$debug = $::os_service_default,
$log_file = '/var/log/trove/guestagent.log',
$log_dir = '/var/log/trove',
$use_syslog = false,
$log_facility = 'LOG_USER',
$use_syslog = $::os_service_default,
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$swift_url = $::os_service_default,
$control_exchange = 'trove',
@ -99,8 +99,6 @@ class trove::guestagent(
# basic service config
trove_guestagent_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/trove_auth_url': value => $auth_url;
'DEFAULT/swift_url': value => $swift_url;
}
@ -145,37 +143,13 @@ class trove::guestagent(
}
}
# Logging
if $log_file {
trove_guestagent_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_guestagent_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_guestagent_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_guestagent_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_guestagent_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_guestagent_config {
'DEFAULT/use_syslog': value => false;
}
oslo::log { 'trove_guestagent_config':
debug => $debug,
verbose => $verbose,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}
trove::generic_service { 'guestagent':

View File

@ -88,12 +88,12 @@
class trove::taskmanager(
$enabled = true,
$manage_service = true,
$debug = false,
$verbose = false,
$debug = $::os_service_default,
$verbose = $::os_service_default,
$log_file = '/var/log/trove/trove-taskmanager.log',
$log_dir = '/var/log/trove',
$use_syslog = false,
$log_facility = 'LOG_USER',
$use_syslog = $::os_service_default,
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$heat_url = false,
$ensure_package = 'present',
@ -126,8 +126,6 @@ class trove::taskmanager(
# basic service config
trove_taskmanager_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/trove_auth_url': value => $auth_url;
'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
@ -209,37 +207,13 @@ class trove::taskmanager(
}
}
# Logging
if $log_file {
trove_taskmanager_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_taskmanager_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_taskmanager_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_taskmanager_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_taskmanager_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_taskmanager_config {
'DEFAULT/use_syslog': value => false;
}
oslo::log { 'trove_taskmanager_config':
debug => $debug,
verbose => $verbose,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}
trove::generic_service { 'taskmanager':

View File

@ -26,8 +26,12 @@ describe 'trove::conductor' do
end
it 'configures trove-conductor with default parameters' do
is_expected.to contain_trove_conductor_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_conductor_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_conductor_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/log_file').with_value('/var/log/trove/trove-conductor.log')
is_expected.to contain_trove_conductor_config('DEFAULT/log_dir').with_value('/var/log/trove')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')

View File

@ -27,8 +27,12 @@ describe 'trove::guestagent' do
end
it 'configures trove-guestagent with default parameters' do
is_expected.to contain_trove_guestagent_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_guestagent_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/log_file').with_value('/var/log/trove/guestagent.log')
is_expected.to contain_trove_guestagent_config('DEFAULT/log_dir').with_value('/var/log/trove')
is_expected.to contain_trove_guestagent_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')

View File

@ -51,8 +51,12 @@ describe 'trove::taskmanager' do
end
it 'configures trove-taskmanager with default parameters' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_taskmanager_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_taskmanager_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/log_file').with_value('/var/log/trove/trove-taskmanager.log')
is_expected.to contain_trove_taskmanager_config('DEFAULT/log_dir').with_value('/var/log/trove')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')