diff --git a/README.md b/README.md index a90921a2..8b8b393a 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,12 @@ gnocchi is a combination of Puppet manifest and ruby code to delivery configurat The `gnocchi_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/gnocchi/gnocchi.conf` file. ```puppet -gnocchi_config { 'DEFAULT/verbose' : +gnocchi_config { 'DEFAULT/debug' : value => true, } ``` -This will write `verbose=true` in the `[DEFAULT]` section. +This will write `debug=true` in the `[DEFAULT]` section. ##### name diff --git a/manifests/init.pp b/manifests/init.pp index 3d29381f..3f22a7c8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,10 +14,6 @@ # any directory. # Defaults to undef # -# [*verbose*] -# (optional) Set log output to verbose output. -# Defaults to undef -# # [*debug*] # (optional) Set log output to debug output. # Defaults to undef @@ -38,17 +34,29 @@ # (optional) Connection url for the gnocchi database. # Defaults to undef. # +# DEPRECATED PARAMETERS +# +# [*verbose*] +# (optional) Deprecated. Set log output to verbose output. +# Defaults to undef +# class gnocchi ( - $ensure_package = 'present', - $verbose = undef, - $debug = undef, - $use_syslog = undef, - $use_stderr = undef, - $log_dir = undef, - $log_facility = undef, - $database_connection = undef, + $ensure_package = 'present', + $debug = undef, + $use_syslog = undef, + $use_stderr = undef, + $log_dir = undef, + $log_facility = undef, + $database_connection = undef, + # Deprecated + $verbose = undef, ) inherits gnocchi::params { + + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + include ::gnocchi::db include ::gnocchi::logging diff --git a/manifests/logging.pp b/manifests/logging.pp index 0e103873..377ff0f2 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -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 @@ -84,18 +80,23 @@ # it like this (string value). # Defaults to $::os_service_default # example: instance_uuid_format='[instance: %(uuid)s] ' - +# # [*log_date_format*] # (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 gnocchi::logging( $use_syslog = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/gnocchi', - $verbose = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -108,20 +109,24 @@ class gnocchi::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.') + } + # note(spredzy): in order to keep backward compatibility we rely on the pick function # to use gnocchi:: first then gnocchi::logging::. $use_syslog_real = pick($::gnocchi::use_syslog,$use_syslog) $use_stderr_real = pick($::gnocchi::use_stderr,$use_stderr) $log_facility_real = pick($::gnocchi::log_facility,$log_facility) $log_dir_real = pick($::gnocchi::log_dir,$log_dir) - $verbose_real = pick($::gnocchi::verbose,$verbose) $debug_real = pick($::gnocchi::debug,$debug) oslo::log { 'gnocchi_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-586c044e066c05d9.yaml b/releasenotes/notes/verbose-deprecation-586c044e066c05d9.yaml new file mode 100644 index 00000000..ecfc2567 --- /dev/null +++ b/releasenotes/notes/verbose-deprecation-586c044e066c05d9.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - verbose option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/acceptance/basic_gnocchi_spec.rb b/spec/acceptance/basic_gnocchi_spec.rb index 3c4c8a35..af79dd00 100644 --- a/spec/acceptance/basic_gnocchi_spec.rb +++ b/spec/acceptance/basic_gnocchi_spec.rb @@ -23,7 +23,6 @@ describe 'basic gnocchi' do } 'RedHat': { class { '::gnocchi': - verbose => true, debug => true, database_connection => 'mysql+pymysql://gnocchi:a_big_secret@127.0.0.1/gnocchi?charset=utf8', } diff --git a/spec/classes/gnocchi_logging_spec.rb b/spec/classes/gnocchi_logging_spec.rb index 64abba52..11a2c981 100644 --- a/spec/classes/gnocchi_logging_spec.rb +++ b/spec/classes/gnocchi_logging_spec.rb @@ -27,7 +27,6 @@ describe 'gnocchi::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/tmp/gnocchi', - :verbose => true, :debug => true, } end @@ -60,7 +59,6 @@ describe 'gnocchi::logging' do is_expected.to contain_gnocchi_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_gnocchi_config('DEFAULT/syslog_log_facility').with(:value => '') is_expected.to contain_gnocchi_config('DEFAULT/log_dir').with(:value => '/var/log/gnocchi') - is_expected.to contain_gnocchi_config('DEFAULT/verbose').with(:value => '') is_expected.to contain_gnocchi_config('DEFAULT/debug').with(:value => '') end end @@ -71,7 +69,6 @@ describe 'gnocchi::logging' do is_expected.to contain_gnocchi_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_gnocchi_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO') is_expected.to contain_gnocchi_config('DEFAULT/log_dir').with(:value => '/tmp/gnocchi') - is_expected.to contain_gnocchi_config('DEFAULT/verbose').with(:value => 'true') is_expected.to contain_gnocchi_config('DEFAULT/debug').with(:value => 'true') end end