From f7b1ed08577affd20b4d3cf045b2cbf37c3291a4 Mon Sep 17 00:00:00 2001 From: Iury Gregory Melo Ferreira Date: Wed, 18 May 2016 00:07:17 -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 README -Remove verbose from tests. If this option is not set explicitly, there is no such warning. Change-Id: I1195b682a9aed4acbb2f198eeee043a9d8ee0ae4 --- README.md | 6 ++-- manifests/init.pp | 29 ++++++++++++------- manifests/inspector/logging.pp | 20 ++++++++----- manifests/logging.pp | 17 ++++++++--- .../verbose-deprecation-3ad00934a7310ca8.yaml | 4 +++ spec/acceptance/ironic_wsgi_apache_spec.rb | 1 - spec/classes/ironic_init_spec.rb | 1 - spec/classes/ironic_inspector_logging_spec.rb | 3 -- spec/classes/ironic_logging_spec.rb | 3 -- 9 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 releasenotes/notes/verbose-deprecation-3ad00934a7310ca8.yaml diff --git a/README.md b/README.md index f9e415ed..75804347 100644 --- a/README.md +++ b/README.md @@ -88,12 +88,12 @@ puppet-ironic is a combination of Puppet manifest and ruby code to delivery conf The `ironic_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/ironic/ironic.conf` file. ```puppet -ironic_config { 'DEFAULT/verbose' : - value => true, +ironic_config { 'DEFAULT/my_ip' : + value => 127.0.0.1, } ``` -This will write `verbose=true` in the `[DEFAULT]` section. +This will write `my_ip=127.0.0.1` in the `[DEFAULT]` section. ##### name diff --git a/manifests/init.pp b/manifests/init.pp index bfabda95..861b4db9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,10 +29,6 @@ # (optional) The state of the package # Defaults to 'present' # -# [*verbose*] -# (optional) Verbose logging -# Defaults to False -# # [*debug*] # (optional) Print debug messages in the logs # Defaults to False @@ -72,11 +68,6 @@ # (optional) List of clustered rabbit servers. (string value) # Defaults to $::os_service_default # -# [*rabbit_user*] -# (optional) User to connect to the rabbit server. -# Defaults to undef. -# Deprecated, use rabbit_userid instead. -# # [*rabbit_userid*] # (optional) User used to connect to rabbitmq. (string value) # Defaults to $::os_service_default @@ -280,10 +271,21 @@ # Enable dbsync # Defaults to true # +# DEPRECATED PARAMETERS +# +# [*rabbit_user*] +# (optional) User to connect to the rabbit server. +# Defaults to undef. +# Deprecated, use rabbit_userid instead. +# +# [*verbose*] +# (optional) Deprecated, Verbose logging +# Defaults to undef + + class ironic ( $enabled = true, $package_ensure = 'present', - $verbose = undef, $debug = undef, $my_ip = $::os_service_default, $use_syslog = undef, @@ -341,13 +343,18 @@ class ironic ( $glance_api_insecure = false, $sync_db = true, # DEPRECATED PARAMETERS - $rabbit_user = undef, + $rabbit_user = undef, + $verbose = undef, ) { include ::ironic::logging include ::ironic::db include ::ironic::params + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + if $rabbit_user { warning('The rabbit_user parameter is deprecated. Please use rabbit_userid instead.') $rabbit_user_real = $rabbit_user diff --git a/manifests/inspector/logging.pp b/manifests/inspector/logging.pp index 98164f90..50fb7834 100644 --- a/manifests/inspector/logging.pp +++ b/manifests/inspector/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 @@ -88,13 +84,18 @@ # (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 ironic::inspector::logging( $use_syslog = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/ironic-inspector', - $verbose = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -107,6 +108,8 @@ class ironic::inspector::logging( $instance_format = $::os_service_default, $instance_uuid_format = $::os_service_default, $log_date_format = $::os_service_default, + #Deprecated + $verbose = undef, ) { $debug_real = pick($::ironic::inspector::debug,$debug) @@ -116,9 +119,12 @@ class ironic::inspector::logging( $default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',') } + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + ironic_inspector_config { 'DEFAULT/debug': value => $debug_real; - 'DEFAULT/verbose': value => $verbose; 'DEFAULT/use_stderr': value => $use_stderr; 'DEFAULT/use_syslog': value => $use_syslog; 'DEFAULT/log_dir': value => $log_dir; diff --git a/manifests/logging.pp b/manifests/logging.pp index 212108ae..f6ea7ba0 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -88,13 +88,18 @@ # (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 ironic::logging( $use_syslog = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/ironic', - $verbose = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -107,6 +112,8 @@ class ironic::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 @@ -115,12 +122,14 @@ class ironic::logging( $use_stderr_real = pick($::ironic::use_stderr,$use_stderr) $log_facility_real = pick($::ironic::log_facility,$log_facility) $log_dir_real = pick($::ironic::log_dir,$log_dir) - $verbose_real = pick($::ironic::verbose,$verbose) $debug_real = pick($::ironic::debug,$debug) + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + oslo::log { 'ironic_config': debug => $debug_real, - verbose => $verbose_real, use_stderr => $use_stderr_real, use_syslog => $use_syslog_real, log_dir => $log_dir_real, diff --git a/releasenotes/notes/verbose-deprecation-3ad00934a7310ca8.yaml b/releasenotes/notes/verbose-deprecation-3ad00934a7310ca8.yaml new file mode 100644 index 00000000..ecfc2567 --- /dev/null +++ b/releasenotes/notes/verbose-deprecation-3ad00934a7310ca8.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - verbose option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/acceptance/ironic_wsgi_apache_spec.rb b/spec/acceptance/ironic_wsgi_apache_spec.rb index 5f62ec42..1163b5f1 100644 --- a/spec/acceptance/ironic_wsgi_apache_spec.rb +++ b/spec/acceptance/ironic_wsgi_apache_spec.rb @@ -37,7 +37,6 @@ describe 'basic ironic' do rabbit_host => '127.0.0.1', database_connection => 'mysql+pymysql://ironic:a_big_secret@127.0.0.1/ironic?charset=utf8', debug => true, - verbose => true, enabled_drivers => ['pxe_ssh'], } class { '::ironic::db::mysql': diff --git a/spec/classes/ironic_init_spec.rb b/spec/classes/ironic_init_spec.rb index f604c651..e6fd1f8b 100644 --- a/spec/classes/ironic_init_spec.rb +++ b/spec/classes/ironic_init_spec.rb @@ -24,7 +24,6 @@ describe 'ironic' do let :params do { :package_ensure => 'present', - :verbose => false, :debug => false, :enabled_drivers => ['pxe_ipmitool'], :database_connection => 'sqlite:////var/lib/ironic/ironic.sqlite', diff --git a/spec/classes/ironic_inspector_logging_spec.rb b/spec/classes/ironic_inspector_logging_spec.rb index 27c5621d..4e4929da 100644 --- a/spec/classes/ironic_inspector_logging_spec.rb +++ b/spec/classes/ironic_inspector_logging_spec.rb @@ -27,7 +27,6 @@ describe 'ironic::inspector::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', - :verbose => true, :debug => true, } end @@ -59,7 +58,6 @@ describe 'ironic::inspector::logging' do is_expected.to contain_ironic_inspector_config('DEFAULT/use_syslog').with(:value => '') is_expected.to contain_ironic_inspector_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_ironic_inspector_config('DEFAULT/log_dir').with(:value => '/var/log/ironic-inspector') - is_expected.to contain_ironic_inspector_config('DEFAULT/verbose').with(:value => '') is_expected.to contain_ironic_inspector_config('DEFAULT/debug').with(:value => '') end end @@ -70,7 +68,6 @@ describe 'ironic::inspector::logging' do is_expected.to contain_ironic_inspector_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_ironic_inspector_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO') is_expected.to contain_ironic_inspector_config('DEFAULT/log_dir').with(:value => '/var/log') - is_expected.to contain_ironic_inspector_config('DEFAULT/verbose').with(:value => 'true') is_expected.to contain_ironic_inspector_config('DEFAULT/debug').with(:value => 'true') end end diff --git a/spec/classes/ironic_logging_spec.rb b/spec/classes/ironic_logging_spec.rb index ca203d85..06a2e85a 100644 --- a/spec/classes/ironic_logging_spec.rb +++ b/spec/classes/ironic_logging_spec.rb @@ -27,7 +27,6 @@ describe 'ironic::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', - :verbose => true, :debug => true, } end @@ -59,7 +58,6 @@ describe 'ironic::logging' do is_expected.to contain_ironic_config('DEFAULT/use_syslog').with(:value => '') is_expected.to contain_ironic_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_ironic_config('DEFAULT/log_dir').with(:value => '/var/log/ironic') - is_expected.to contain_ironic_config('DEFAULT/verbose').with(:value => '') is_expected.to contain_ironic_config('DEFAULT/debug').with(:value => '') end end @@ -70,7 +68,6 @@ describe 'ironic::logging' do is_expected.to contain_ironic_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_ironic_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO') is_expected.to contain_ironic_config('DEFAULT/log_dir').with(:value => '/var/log') - is_expected.to contain_ironic_config('DEFAULT/verbose').with(:value => 'true') is_expected.to contain_ironic_config('DEFAULT/debug').with(:value => 'true') end end