Deprecate verbose option in logging

Option "verbose" from group "DEFAULT" is deprecated for removal.
The parameter has no effect.
-Deprecated verbose for logging and init
-Remove verbose in README
-Remove verbose from tests.

If this option is not set explicitly, there is no such warning

Change-Id: I7e58412fe26962337845b3cb9d67679bac0709d8
changes/26/317826/1
Iury Gregory Melo Ferreira 7 years ago
parent 283e33c00b
commit cf604fc6a6

@ -44,7 +44,6 @@ To utilize the glance module's functionality you will need to declare multiple r
```puppet
class { 'glance::api':
verbose => true,
keystone_tenant => 'services',
keystone_user => 'glance',
keystone_password => '12345',
@ -52,7 +51,6 @@ class { 'glance::api':
}
class { 'glance::registry':
verbose => true,
keystone_tenant => 'services',
keystone_user => 'glance',
keystone_password => '12345',
@ -112,12 +110,12 @@ class { 'glance::notify::rabbitmq':
The `glance_api_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/glance/glance-api.conf` file.
```puppet
glance_api_config { 'DEFAULT/verbose' :
value => true,
glance_api_config { 'DEFAULT/image_cache_dir' :
value => /var/lib/glance/image-cache,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `image_cache_dir=/var/lib/glance/image-cache` in the `[DEFAULT]` section.
##### name
@ -140,12 +138,12 @@ If value is equal to ensure_absent_val then the resource will behave as if `ensu
The `glance_registry_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/glance/glance-registry.conf` file.
```puppet
glance_registry_config { 'DEFAULT/verbose' :
value => true,
glance_registry_config { 'DEFAULT/workers' :
value => 1,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `workers=1` in the `[DEFAULT]` section.
##### name
@ -168,12 +166,12 @@ If value is equal to ensure_absent_val then the resource will behave as if `ensu
The `glance_cache_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/glance/glance-cache.conf` file.
```puppet
glance_cache_config { 'DEFAULT/verbose' :
value => true,
glance_cache_config { 'DEFAULT/image_cache_stall_time' :
value => 86400,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `image_cache_stall_time=86400` in the `[DEFAULT]` section.
##### name

@ -12,10 +12,6 @@
# setting is ignored and the setting from the glance class is used
# because there is only one glance package. Defaults to 'present'.
#
# [*verbose*]
# (optional) Rather to log the glance api service at verbose level.
# Default: undef
#
# [*debug*]
# (optional) Rather to log the glance api service at debug level.
# Default: undef
@ -267,10 +263,13 @@
# Defaults to false.
# Example: ['file','http']
#
# [*verbose*]
# (optional) Deprecated. Rather to log the glance api service at verbose level.
# Default: undef
class glance::api(
$keystone_password,
$package_ensure = 'present',
$verbose = undef,
$debug = undef,
$bind_host = $::os_service_default,
$bind_port = '9292',
@ -326,6 +325,7 @@ class glance::api(
$validation_options = {},
# DEPRECATED PARAMETERS
$known_stores = false,
$verbose = undef,
) inherits glance {
include ::glance::policy
@ -333,6 +333,10 @@ class glance::api(
include ::glance::api::logging
include ::glance::cache::logging
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if ( $glance::params::api_package_name != $glance::params::registry_package_name ) {
ensure_packages('glance-api',
{

@ -4,10 +4,6 @@
#
# == parameters
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to $::os_service_default.
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default.
@ -92,14 +88,19 @@
# (optional) Format string for %%(asctime)s in log records.
# Defaults to $::os_service_default.
# Example: 'Y-%m-%d %H:%M:%S'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef
#
class glance::api::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/glance',
$log_file = '/var/log/glance/api.log',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -112,6 +113,8 @@ class glance::api::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
@ -121,12 +124,14 @@ class glance::api::logging(
$log_facility_real = pick($::glance::api::log_facility,$log_facility)
$log_dir_real = pick($::glance::api::log_dir,$log_dir)
$log_file_real = pick($::glance::api::log_file,$log_file)
$verbose_real = pick($::glance::api::verbose,$verbose)
$debug_real = pick($::glance::api::debug,$debug)
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'glance_api_config':
debug => $debug_real,
verbose => $verbose_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,

@ -4,10 +4,6 @@
#
# == parameters
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to $::os_service_default.
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default.
@ -92,6 +88,13 @@
# (optional) Format string for %%(asctime)s in log records.
# Defaults to $::os_service_default.
# Example: 'Y-%m-%d %H:%M:%S'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef
class glance::cache::logging(
$use_syslog = $::os_service_default,
@ -99,7 +102,6 @@ class glance::cache::logging(
$log_facility = $::os_service_default,
$log_dir = '/var/log/glance',
$log_file = '/var/log/glance/cache.log',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -112,18 +114,22 @@ class glance::cache::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
$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)
$verbose_real = pick($::glance::api::verbose,$verbose)
$debug_real = pick($::glance::api::debug,$debug)
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'glance_cache_config':
debug => $debug_real,
verbose => $verbose_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,

@ -4,10 +4,6 @@
#
# === Parameters
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages.
# Defaults to $::os_service_default.
#
# [*debug*]
# (Optional) Should the daemons log debug messages.
# Defaults to $::os_service_default.
@ -93,13 +89,18 @@
# Defaults to $::os_service_default.
# Example: 'Y-%m-%d %H:%M:%S'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages.
# Defaults to undef
#
class glance::glare::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/glance',
$log_file = '/var/log/glance/glare.log',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -112,11 +113,16 @@ class glance::glare::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'glance_glare_config':
debug => $debug,
verbose => $verbose,
use_stderr => $use_stderr,
use_syslog => $use_syslog,
log_dir => $log_dir,

@ -12,9 +12,6 @@
# platforms this setting is ignored and the setting from the glance class is
# used because there is only one glance package.
#
# [*verbose*]
# (optional) Enable verbose logs (true|false). Defaults to undef.
#
# [*debug*]
# (optional) Enable debug logs (true|false). Defaults to undef.
#
@ -153,10 +150,14 @@
# Set to -1 to disable caching completely.
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (optional) Deprecated. Enable verbose logs (true|false). Defaults to undef.
#
class glance::registry(
$keystone_password,
$package_ensure = 'present',
$verbose = undef,
$debug = undef,
$bind_host = $::os_service_default,
$bind_port = '9191',
@ -190,11 +191,17 @@ class glance::registry(
$signing_dir = $::os_service_default,
$memcached_servers = $::os_service_default,
$token_cache_time = $::os_service_default,
# Deprecated
$verbose = undef,
) inherits glance {
include ::glance::registry::logging
include ::glance::registry::db
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if ( $glance::params::api_package_name != $glance::params::registry_package_name ) {
ensure_packages( 'glance-registry',
{

@ -4,10 +4,6 @@
#
# == parameters
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to $::os_service_default.
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default.
@ -92,14 +88,19 @@
# (optional) Format string for %%(asctime)s in log records.
# Defaults to $::os_service_default.
# Example: 'Y-%m-%d %H:%M:%S'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef
#
class glance::registry::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/glance',
$log_file = '/var/log/glance/registry.log',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -112,6 +113,8 @@ class glance::registry::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
@ -121,12 +124,14 @@ class glance::registry::logging(
$log_facility_real = pick($::glance::registry::log_facility,$log_facility)
$log_dir_real = pick($::glance::registry::log_dir,$log_dir)
$log_file_real = pick($::glance::registry::log_file,$log_file)
$verbose_real = pick($::glance::registry::verbose,$verbose)
$debug_real = pick($::glance::registry::debug,$debug)
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'glance_registry_config':
debug => $debug_real,
verbose => $verbose_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,

@ -0,0 +1,4 @@
---
deprecations:
- verbose option is now deprecated for removal, the
parameter has no effect.

@ -26,12 +26,10 @@ describe 'glance class' do
}
class { '::glance::api':
database_connection => 'mysql+pymysql://glance:a_big_secret@127.0.0.1/glance?charset=utf8',
verbose => false,
keystone_password => 'a_big_secret',
}
class { '::glance::registry':
database_connection => 'mysql+pymysql://glance:a_big_secret@127.0.0.1/glance?charset=utf8',
verbose => false,
keystone_password => 'a_big_secret',
}
class { '::glance::glare::db':

@ -28,7 +28,6 @@ describe 'glance::api::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/glance_api_random.log',
:verbose => true,
:debug => true,
}
end
@ -61,7 +60,6 @@ describe 'glance::api::logging' do
is_expected.to contain_glance_api_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('DEFAULT/log_dir').with(:value => '/var/log/glance')
is_expected.to contain_glance_api_config('DEFAULT/log_file').with(:value => '/var/log/glance/api.log')
is_expected.to contain_glance_api_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -73,7 +71,6 @@ describe 'glance::api::logging' do
is_expected.to contain_glance_api_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_glance_api_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_glance_api_config('DEFAULT/log_file').with(:value => '/var/tmp/glance_api_random.log')
is_expected.to contain_glance_api_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_glance_api_config('DEFAULT/debug').with(:value => 'true')
end
end

@ -4,7 +4,6 @@ describe 'glance::api' do
let :default_params do
{
:verbose => false,
:debug => false,
:use_stderr => '<SERVICE DEFAULT>',
:bind_host => '<SERVICE DEFAULT>',
@ -47,7 +46,6 @@ describe 'glance::api' do
shared_examples_for 'glance::api' do
[{:keystone_password => 'ChangeMe'},
{
:verbose => true,
:debug => true,
:bind_host => '127.0.0.1',
:bind_port => '9222',

@ -28,7 +28,6 @@ describe 'glance::cache::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/glance_cache_random.log',
:verbose => true,
:debug => true,
}
end
@ -60,7 +59,6 @@ describe 'glance::cache::logging' do
is_expected.to contain_glance_cache_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('DEFAULT/log_dir').with(:value => '/var/log/glance')
is_expected.to contain_glance_cache_config('DEFAULT/log_file').with(:value => '/var/log/glance/cache.log')
end
@ -73,7 +71,6 @@ describe 'glance::cache::logging' do
is_expected.to contain_glance_cache_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_glance_cache_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_glance_cache_config('DEFAULT/log_file').with(:value => '/var/tmp/glance_cache_random.log')
is_expected.to contain_glance_cache_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_glance_cache_config('DEFAULT/debug').with(:value => 'true')
end
end

@ -28,7 +28,6 @@ describe 'glance::glare::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/glance_glare_random.log',
:verbose => true,
:debug => true,
}
end
@ -61,7 +60,6 @@ describe 'glance::glare::logging' do
is_expected.to contain_glance_glare_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_glare_config('DEFAULT/log_dir').with(:value => '/var/log/glance')
is_expected.to contain_glance_glare_config('DEFAULT/log_file').with(:value => '/var/log/glance/glare.log')
is_expected.to contain_glance_glare_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_glare_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -73,7 +71,6 @@ describe 'glance::glare::logging' do
is_expected.to contain_glance_glare_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_glance_glare_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_glance_glare_config('DEFAULT/log_file').with(:value => '/var/tmp/glance_glare_random.log')
is_expected.to contain_glance_glare_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_glance_glare_config('DEFAULT/debug').with(:value => 'true')
end
end

@ -28,7 +28,6 @@ describe 'glance::registry::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/glance_registry_random.log',
:verbose => true,
:debug => true,
}
end
@ -61,7 +60,6 @@ describe 'glance::registry::logging' do
is_expected.to contain_glance_registry_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_registry_config('DEFAULT/log_dir').with(:value => '/var/log/glance')
is_expected.to contain_glance_registry_config('DEFAULT/log_file').with(:value => '/var/log/glance/registry.log')
is_expected.to contain_glance_registry_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_glance_registry_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -73,7 +71,6 @@ describe 'glance::registry::logging' do
is_expected.to contain_glance_registry_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_glance_registry_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_glance_registry_config('DEFAULT/log_file').with(:value => '/var/tmp/glance_registry_random.log')
is_expected.to contain_glance_registry_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_glance_registry_config('DEFAULT/debug').with(:value => 'true')
end
end

@ -2,7 +2,6 @@
describe 'glance::registry' do
let :default_params do
{
:verbose => false,
:debug => false,
:use_stderr => '<SERVICE DEFAULT>',
:bind_host => '<SERVICE DEFAULT>',

@ -1,4 +1,3 @@
class { '::glance::api':
debug => true,
verbose => true,
}

@ -1,4 +1,3 @@
class { '::glance::registry':
debug => true,
verbose => true,
}

@ -6,7 +6,6 @@ Exec { logoutput => 'on_failure' }
node glance_keystone_mysql {
class { '::mysql::server': }
class { '::keystone':
verbose => true,
debug => true,
catalog_type => 'sql',
admin_token => 'admin_token',
@ -19,7 +18,6 @@ node glance_keystone_mysql {
password => 'ChangeMe',
}
class { '::glance::api':
verbose => true,
debug => true,
auth_type => 'keystone',
keystone_tenant => 'services',
@ -39,7 +37,6 @@ node glance_keystone_mysql {
}
class { '::glance::registry':
verbose => true,
debug => true,
auth_type => 'keystone',
keystone_tenant => 'services',

Loading…
Cancel
Save