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

View File

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

View File

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

View File

@ -26,8 +26,12 @@ describe 'trove::conductor' do
end end
it 'configures trove-conductor with default parameters' do 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/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/debug').with_value(false) 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_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_pass').with_value('verysecrete')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin') 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 end
it 'configures trove-guestagent with default parameters' do 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/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value(false) 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('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/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/topics').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 end
it 'configures trove-taskmanager with default parameters' do 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/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/debug').with_value(false) 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_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_pass').with_value('verysecrete')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin') is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')