Remove deprecated logging

Change-Id: Id33a11d8eb74bc4685b7c1e88de9f73df1404e03
This commit is contained in:
Tobias Urdin
2018-11-29 10:19:15 +01:00
parent d74f80bdc2
commit f09800121b
8 changed files with 23 additions and 131 deletions

View File

@@ -9,10 +9,6 @@
# setting is ignored and the setting from the glance class is used # setting is ignored and the setting from the glance class is used
# because there is only one glance package. Defaults to 'present'. # because there is only one glance package. Defaults to 'present'.
# #
# [*debug*]
# (optional) Rather to log the glance api service at debug level.
# Default: undef
#
# [*bind_host*] # [*bind_host*]
# (optional) The address of the host to bind to. # (optional) The address of the host to bind to.
# Default: $::os_service_default. # Default: $::os_service_default.
@@ -29,16 +25,6 @@
# (optional) Number of Glance API worker processes to start # (optional) Number of Glance API worker processes to start
# Default: $::os_workers. # Default: $::os_workers.
# #
# [*log_file*]
# (optional) The path of file used for logging
# If set to $::os_service_default, it will not log to any file.
# Default: undef
#
# [*log_dir*]
# (optional) directory to which glance logs are sent.
# If set to $::os_service_default, it will not log to any directory.
# Defaults to undef
#
# [*registry_host*] # [*registry_host*]
# (optional) The address used to connect to the registry service. # (optional) The address used to connect to the registry service.
# Default: 0.0.0.0 # Default: 0.0.0.0
@@ -122,18 +108,6 @@
# (optional) Desired output format for image conversion plugin. # (optional) Desired output format for image conversion plugin.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to undef
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to undef
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to undef
#
# [*show_image_direct_url*] # [*show_image_direct_url*]
# (optional) Expose image location to trusted clients. # (optional) Expose image location to trusted clients.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
@@ -319,13 +293,10 @@
# #
class glance::api( class glance::api(
$package_ensure = 'present', $package_ensure = 'present',
$debug = undef,
$bind_host = $::os_service_default, $bind_host = $::os_service_default,
$bind_port = '9292', $bind_port = '9292',
$backlog = $::os_service_default, $backlog = $::os_service_default,
$workers = $::os_workers, $workers = $::os_workers,
$log_file = undef,
$log_dir = undef,
$registry_host = '0.0.0.0', $registry_host = '0.0.0.0',
$registry_port = $::os_service_default, $registry_port = $::os_service_default,
$registry_client_protocol = $::os_service_default, $registry_client_protocol = $::os_service_default,
@@ -335,9 +306,6 @@ class glance::api(
$pipeline = 'keystone', $pipeline = 'keystone',
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,
$use_syslog = undef,
$use_stderr = undef,
$log_facility = undef,
$show_image_direct_url = $::os_service_default, $show_image_direct_url = $::os_service_default,
$show_multiple_locations = $::os_service_default, $show_multiple_locations = $::os_service_default,
$filesystem_store_metadata_file = $::os_service_default, $filesystem_store_metadata_file = $::os_service_default,
@@ -391,8 +359,6 @@ class glance::api(
include ::glance::deps include ::glance::deps
include ::glance::policy include ::glance::policy
include ::glance::api::db include ::glance::api::db
include ::glance::api::logging
include ::glance::cache::logging
if $sync_db { if $sync_db {
include ::glance::db::sync include ::glance::db::sync

View File

@@ -122,32 +122,15 @@ class glance::api::logging(
include ::glance::deps include ::glance::deps
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use glance::<myparam> first then glance::logging::<myparam>.
$use_syslog_real = pick($::glance::api::use_syslog,$use_syslog)
$use_stderr_real = pick($::glance::api::use_stderr,$use_stderr)
$log_facility_real = pick($::glance::api::log_facility,$log_facility)
if $log_dir != '' {
$log_dir_real = pick($::glance::api::log_dir,$log_dir)
} else {
$log_dir_real = $log_dir
}
if $log_file != '' {
$log_file_real = pick($::glance::api::log_file,$log_file)
} else {
$log_file_real = $log_file
}
$debug_real = pick($::glance::api::debug,$debug)
oslo::log { 'glance_api_config': oslo::log { 'glance_api_config':
debug => $debug_real, debug => $debug,
use_stderr => $use_stderr_real, use_stderr => $use_stderr,
use_syslog => $use_syslog_real, use_syslog => $use_syslog,
use_json => $use_json, use_json => $use_json,
use_journal => $use_journal, use_journal => $use_journal,
log_dir => $log_dir_real, log_dir => $log_dir,
log_file => $log_file_real, log_file => $log_file,
syslog_log_facility => $log_facility_real, syslog_log_facility => $log_facility,
logging_context_format_string => $logging_context_format_string, logging_context_format_string => $logging_context_format_string,
logging_default_format_string => $logging_default_format_string, logging_default_format_string => $logging_default_format_string,
logging_debug_format_suffix => $logging_debug_format_suffix, logging_debug_format_suffix => $logging_debug_format_suffix,

View File

@@ -116,20 +116,14 @@ class glance::cache::logging(
include ::glance::deps include ::glance::deps
$use_syslog_real = pick($::glance::api::use_syslog,$use_syslog)
$use_stderr_real = pick($::glance::api::use_stderr,$use_stderr)
$log_facility_real = pick($::glance::api::log_facility,$log_facility)
$log_dir_real = pick($::glance::api::log_dir,$log_dir)
$debug_real = pick($::glance::api::debug,$debug)
oslo::log { 'glance_cache_config': oslo::log { 'glance_cache_config':
debug => $debug_real, debug => $debug,
use_stderr => $use_stderr_real, use_stderr => $use_stderr,
use_syslog => $use_syslog_real, use_syslog => $use_syslog,
use_json => $use_json, use_json => $use_json,
log_dir => $log_dir_real, log_dir => $log_dir,
log_file => $log_file, log_file => $log_file,
syslog_log_facility => $log_facility_real, syslog_log_facility => $log_facility,
logging_context_format_string => $logging_context_format_string, logging_context_format_string => $logging_context_format_string,
logging_default_format_string => $logging_default_format_string, logging_default_format_string => $logging_default_format_string,
logging_debug_format_suffix => $logging_debug_format_suffix, logging_debug_format_suffix => $logging_debug_format_suffix,

View File

@@ -9,9 +9,6 @@
# platforms this setting is ignored and the setting from the glance class is # platforms this setting is ignored and the setting from the glance class is
# used because there is only one glance package. # used because there is only one glance package.
# #
# [*debug*]
# (optional) Enable debug logs (true|false). Defaults to undef.
#
# [*bind_host*] # [*bind_host*]
# (optional) The address of the host to bind to. # (optional) The address of the host to bind to.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
@@ -24,16 +21,6 @@
# created to service Registry requests. # created to service Registry requests.
# Defaults to: $::os_workers. # Defaults to: $::os_workers.
# #
# [*log_file*]
# (optional) Log file for glance-registry.
# If set to $::os_service_default, it will not log to any file.
# Defaults to undef.
#
# [*log_dir*]
# (optional) directory to which glance logs are sent.
# If set to $::os_service_default, it will not log to any directory.
# Defaults to undef.
#
# [*database_connection*] # [*database_connection*]
# (optional) Connection url to connect to glance database. # (optional) Connection url to connect to glance database.
# Defaults to undef # Defaults to undef
@@ -72,18 +59,6 @@
# file with the service name removed. # file with the service name removed.
# Defaults to 'keystone'. # Defaults to 'keystone'.
# #
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to undef.
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to undef.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to undef.
#
# [*manage_service*] # [*manage_service*]
# (optional) If Puppet should manage service startup / shutdown. # (optional) If Puppet should manage service startup / shutdown.
# Defaults to true. # Defaults to true.
@@ -123,12 +98,9 @@
# #
class glance::registry( class glance::registry(
$package_ensure = 'present', $package_ensure = 'present',
$debug = undef,
$bind_host = $::os_service_default, $bind_host = $::os_service_default,
$bind_port = '9191', $bind_port = '9191',
$workers = $::os_workers, $workers = $::os_workers,
$log_file = undef,
$log_dir = undef,
$database_connection = undef, $database_connection = undef,
$database_idle_timeout = undef, $database_idle_timeout = undef,
$database_min_pool_size = undef, $database_min_pool_size = undef,
@@ -138,9 +110,6 @@ class glance::registry(
$database_max_overflow = undef, $database_max_overflow = undef,
$auth_strategy = 'keystone', $auth_strategy = 'keystone',
$pipeline = 'keystone', $pipeline = 'keystone',
$use_syslog = undef,
$use_stderr = undef,
$log_facility = undef,
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,
$purge_config = false, $purge_config = false,
@@ -152,7 +121,6 @@ class glance::registry(
) inherits glance { ) inherits glance {
include ::glance::deps include ::glance::deps
include ::glance::registry::logging
include ::glance::registry::db include ::glance::registry::db
if ( $glance::params::api_package_name != $glance::params::registry_package_name ) { if ( $glance::params::api_package_name != $glance::params::registry_package_name ) {

View File

@@ -122,28 +122,15 @@ class glance::registry::logging(
include ::glance::deps include ::glance::deps
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use glance::<myparam> first, then glance::logging::<myparam>.
$use_syslog_real = pick($::glance::registry::use_syslog,$use_syslog)
$use_stderr_real = pick($::glance::registry::use_stderr,$use_stderr)
$log_facility_real = pick($::glance::registry::log_facility,$log_facility)
if $log_dir != '' {
$log_dir_real = pick($::glance::registry::log_dir,$log_dir)
} else {
$log_dir_real = $log_dir
}
$log_file_real = pick($::glance::registry::log_file,$log_file)
$debug_real = pick($::glance::registry::debug,$debug)
oslo::log { 'glance_registry_config': oslo::log { 'glance_registry_config':
debug => $debug_real, debug => $debug,
use_stderr => $use_stderr_real, use_stderr => $use_stderr,
use_syslog => $use_syslog_real, use_syslog => $use_syslog,
use_json => $use_json, use_json => $use_json,
use_journal => $use_journal, use_journal => $use_journal,
log_dir => $log_dir_real, log_dir => $log_dir,
log_file => $log_file_real, log_file => $log_file,
syslog_log_facility => $log_facility_real, syslog_log_facility => $log_facility,
logging_context_format_string => $logging_context_format_string, logging_context_format_string => $logging_context_format_string,
logging_default_format_string => $logging_default_format_string, logging_default_format_string => $logging_default_format_string,
logging_debug_format_suffix => $logging_debug_format_suffix, logging_debug_format_suffix => $logging_debug_format_suffix,

View File

@@ -0,0 +1,6 @@
---
upgrade:
- |
The deprecated parameters use_syslog, use_stderr, log_facility, log_dir and
debug in the api and registry classes is now removed. Please set them in their
respective logging class.

View File

@@ -9,15 +9,11 @@ describe 'glance::api' do
let :default_params do let :default_params do
{ {
:debug => false,
:use_stderr => '<SERVICE DEFAULT>',
:bind_host => '<SERVICE DEFAULT>', :bind_host => '<SERVICE DEFAULT>',
:bind_port => '9292', :bind_port => '9292',
:registry_host => '0.0.0.0', :registry_host => '0.0.0.0',
:registry_port => '<SERVICE DEFAULT>', :registry_port => '<SERVICE DEFAULT>',
:registry_client_protocol => '<SERVICE DEFAULT>', :registry_client_protocol => '<SERVICE DEFAULT>',
:log_file => '/var/log/glance/api.log',
:log_dir => '/var/log/glance',
:auth_strategy => 'keystone', :auth_strategy => 'keystone',
:enabled => true, :enabled => true,
:manage_service => true, :manage_service => true,
@@ -59,7 +55,6 @@ describe 'glance::api' do
shared_examples_for 'glance::api' do shared_examples_for 'glance::api' do
[{ [{
:debug => true,
:bind_host => '127.0.0.1', :bind_host => '127.0.0.1',
:bind_port => '9222', :bind_port => '9222',
:registry_host => '127.0.0.1', :registry_host => '127.0.0.1',
@@ -104,7 +99,6 @@ describe 'glance::api' do
it { is_expected.to contain_class 'glance' } it { is_expected.to contain_class 'glance' }
it { is_expected.to contain_class 'glance::policy' } it { is_expected.to contain_class 'glance::policy' }
it { is_expected.to contain_class 'glance::api::logging' }
it { is_expected.to contain_class 'glance::api::db' } it { is_expected.to contain_class 'glance::api::db' }
it 'is_expected.to not sync the db if sync_db is set to false' do it 'is_expected.to not sync the db if sync_db is set to false' do
@@ -127,7 +121,6 @@ describe 'glance::api' do
it 'is_expected.to lay down default api config' do it 'is_expected.to lay down default api config' do
[ [
'use_stderr',
'bind_host', 'bind_host',
'bind_port', 'bind_port',
'registry_host', 'registry_host',

View File

@@ -9,13 +9,9 @@ describe 'glance::registry' do
let :default_params do let :default_params do
{ {
:debug => false,
:use_stderr => '<SERVICE DEFAULT>',
:bind_host => '<SERVICE DEFAULT>', :bind_host => '<SERVICE DEFAULT>',
:bind_port => '9191', :bind_port => '9191',
:workers => facts[:os_workers], :workers => facts[:os_workers],
:log_file => '/var/log/glance/registry.log',
:log_dir => '/var/log/glance',
:enabled => true, :enabled => true,
:manage_service => true, :manage_service => true,
:purge_config => false, :purge_config => false,
@@ -49,7 +45,6 @@ describe 'glance::registry' do
it { is_expected.to contain_class 'glance::registry' } it { is_expected.to contain_class 'glance::registry' }
it { is_expected.to contain_class 'glance::registry::db' } it { is_expected.to contain_class 'glance::registry::db' }
it { is_expected.to contain_class 'glance::registry::logging' }
it { is_expected.to contain_service('glance-registry').with( it { is_expected.to contain_service('glance-registry').with(
'ensure' => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped', 'ensure' => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',