From d4f5963461fb55b7e9d6201adf8cf590dd62cc41 Mon Sep 17 00:00:00 2001 From: Erickson Santos Date: Mon, 16 May 2016 15:09:04 -0300 Subject: [PATCH] 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 examples and README -Remove verbose from tests. If this option is not set explicitly, there is no such warning. Change-Id: I573b2480195df2e7b390245d418ec5535c8e2cdd --- README.md | 9 +++------ manifests/init.pp | 16 +++++++++++---- manifests/logging.pp | 20 +++++++++++-------- .../verbose-deprecation-c1356f67dccdff3a.yaml | 4 ++++ spec/acceptance/basic_cinder_spec.rb | 1 - spec/classes/cinder_logging_spec.rb | 3 --- 6 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/verbose-deprecation-c1356f67dccdff3a.yaml diff --git a/README.md b/README.md index 3893d1b9..04697d30 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,6 @@ class { 'cinder': database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder', rabbit_password => 'secret_rpc_password_for_blocks', rabbit_host => 'openstack-controller.example.com', - verbose => true, } class { 'cinder::api': @@ -86,7 +85,6 @@ class { 'cinder': database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder', rabbit_password => 'secret_rpc_password_for_blocks', rabbit_host => 'openstack-controller.example.com', - verbose => true, } class { 'cinder::volume': } @@ -103,7 +101,6 @@ class { 'cinder': database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder', rabbit_password => 'secret_rpc_password_for_blocks', rabbit_host => 'openstack-controller.example.com', - verbose => true, } class { 'cinder::volume': } @@ -175,12 +172,12 @@ The `cinder_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/cinder/cinder.conf` file. ```puppet -cinder_config { 'DEFAULT/verbose' : - value => true, +cinder_config { 'DEFAULT/api_paste_config' : + value => '/etc/cinder/api-paste.ini', } ``` -This will write `verbose=true` in the `[DEFAULT]` section. +This will write `api_paste_config=/etc/cinder/api-paste.ini` in the `[DEFAULT]` section. ##### name diff --git a/manifests/init.pp b/manifests/init.pp index 7ffd8669..81fdeb25 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,9 +8,6 @@ # (Optional) Ensure state for package. # Defaults to 'present' # -# [*verbose*] -# (Optional) Should the daemons log verbose messages -# Defaults to undef. # # [*debug*] # (Optional) Should the daemons log debug messages @@ -286,6 +283,12 @@ # in the cinder config. # Defaults to false. # +# DEPRECATED PARAMETERS +# +# [*verbose*] +# (Optional) DEPRECATED. Should the daemons log verbose messages +# Defaults to undef. +# class cinder ( $database_connection = undef, $database_idle_timeout = undef, @@ -340,7 +343,6 @@ class cinder ( $use_stderr = undef, $log_facility = undef, $log_dir = '/var/log/cinder', - $verbose = undef, $debug = undef, $storage_availability_zone = 'nova', $default_availability_zone = false, @@ -351,6 +353,8 @@ class cinder ( $image_conversion_dir = $::os_service_default, $host = $::os_service_default, $purge_config = false, + # DEPRECATED PARAMETERS + $verbose = undef, ) inherits cinder::params { @@ -366,6 +370,10 @@ class cinder ( } } + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + # this anchor is used to simplify the graph between cinder components by # allowing a resource to serve as a point where the configuration of cinder begins anchor { 'cinder-start': } diff --git a/manifests/logging.pp b/manifests/logging.pp index 21952752..e45e7cee 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -3,11 +3,6 @@ # Cinder logging configuration # # === 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 @@ -90,12 +85,17 @@ # 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 cinder::logging( $use_syslog = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/cinder', - $verbose = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -108,20 +108,24 @@ class cinder::logging( $instance_format = $::os_service_default, $instance_uuid_format = $::os_service_default, $log_date_format = $::os_service_default, + # DEPRECATED PARAMETERS + $verbose = undef, ) { + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # to use cinder:: if cinder::logging:: isn't specified. $use_syslog_real = pick($::cinder::use_syslog,$use_syslog) $use_stderr_real = pick($::cinder::use_stderr,$use_stderr) $log_facility_real = pick($::cinder::log_facility,$log_facility) $log_dir_real = pick($::cinder::log_dir,$log_dir) - $verbose_real = pick($::cinder::verbose,$verbose) $debug_real = pick($::cinder::debug,$debug) oslo::log { 'cinder_config': debug => $debug_real, - verbose => $verbose_real, use_syslog => $use_syslog_real, use_stderr => $use_stderr_real, log_dir => $log_dir_real, diff --git a/releasenotes/notes/verbose-deprecation-c1356f67dccdff3a.yaml b/releasenotes/notes/verbose-deprecation-c1356f67dccdff3a.yaml new file mode 100644 index 00000000..ecfc2567 --- /dev/null +++ b/releasenotes/notes/verbose-deprecation-c1356f67dccdff3a.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - verbose option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/acceptance/basic_cinder_spec.rb b/spec/acceptance/basic_cinder_spec.rb index 3e2cb184..d2e4c477 100644 --- a/spec/acceptance/basic_cinder_spec.rb +++ b/spec/acceptance/basic_cinder_spec.rb @@ -34,7 +34,6 @@ describe 'basic cinder' do rabbit_password => 'an_even_bigger_secret', rabbit_host => '127.0.0.1', debug => true, - verbose => true, } class { '::cinder::keystone::auth': password => 'a_big_secret', diff --git a/spec/classes/cinder_logging_spec.rb b/spec/classes/cinder_logging_spec.rb index f8a09167..132aad97 100644 --- a/spec/classes/cinder_logging_spec.rb +++ b/spec/classes/cinder_logging_spec.rb @@ -27,7 +27,6 @@ describe 'cinder::logging' do :use_stderr => false, :log_facility => 'LOG_USER', :log_dir => '/var/log', - :verbose => true, :debug => true, } end @@ -56,7 +55,6 @@ describe 'cinder::logging' do is_expected.to contain_cinder_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/syslog_log_facility').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log/cinder') - is_expected.to contain_cinder_config('DEFAULT/verbose').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/debug').with(:value => '') end end @@ -67,7 +65,6 @@ describe 'cinder::logging' do is_expected.to contain_cinder_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_cinder_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER') is_expected.to contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log') - is_expected.to contain_cinder_config('DEFAULT/verbose').with(:value => 'true') is_expected.to contain_cinder_config('DEFAULT/debug').with(:value => 'true') end end