From dbde71b85510d5076bfdd968e56033ce1b76c4b5 Mon Sep 17 00:00:00 2001 From: Iury Gregory Melo Ferreira Date: Mon, 16 May 2016 10:50:13 -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: I2f554c07f71458894aaa5d8079285ac92d0f04a3 --- README.md | 7 +++---- examples/apache_dropin.pp | 1 - examples/apache_with_paths.pp | 1 - examples/k2k_sp_shib.pp | 1 - examples/ldap_backend.pp | 1 - examples/v3_basic.pp | 1 - examples/v3_domain_configuration.pp | 1 - manifests/init.pp | 15 ++++++++------ manifests/logging.pp | 20 +++++++++++-------- .../verbose-deprecation-38d9b7667fcf381d.yaml | 4 ++++ spec/classes/keystone_logging_spec.rb | 3 --- spec/classes/keystone_spec.rb | 3 --- tests/site.pp | 3 --- 13 files changed, 28 insertions(+), 33 deletions(-) create mode 100644 releasenotes/notes/verbose-deprecation-38d9b7667fcf381d.yaml diff --git a/README.md b/README.md index d11f82728..61741548e 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ To utilize the keystone module's functionality you will need to declare multiple ```puppet class { 'keystone': - verbose => True, catalog_type => 'sql', admin_token => 'random_uuid', database_connection => 'mysql://keystone_admin:super_secret_db_password@openstack-controller.example.com/keystone', @@ -267,12 +266,12 @@ keystone is a combination of Puppet manifest and ruby code to delivery configura The `keystone_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/keystone/keystone.conf` file. ```puppet -keystone_config { 'DEFAULT/verbose' : - value => true, +keystone_config { 'token/expiration' : + value => 3600, } ``` -This will write `verbose=true` in the `[DEFAULT]` section. +This will write `expiration=3600` in the `[token]` section. ##### name diff --git a/examples/apache_dropin.pp b/examples/apache_dropin.pp index 5ed29264f..f06809dc2 100644 --- a/examples/apache_dropin.pp +++ b/examples/apache_dropin.pp @@ -25,7 +25,6 @@ class { '::keystone::db::mysql': password => 'keystone', } class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone', catalog_type => 'sql', diff --git a/examples/apache_with_paths.pp b/examples/apache_with_paths.pp index 8b0fc699c..1d2d849a6 100644 --- a/examples/apache_with_paths.pp +++ b/examples/apache_with_paths.pp @@ -25,7 +25,6 @@ class { '::keystone::db::mysql': password => 'keystone', } class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone_admin:keystone@127.0.0.1/keystone', catalog_type => 'sql', diff --git a/examples/k2k_sp_shib.pp b/examples/k2k_sp_shib.pp index b1a9f1642..990753056 100644 --- a/examples/k2k_sp_shib.pp +++ b/examples/k2k_sp_shib.pp @@ -42,7 +42,6 @@ class { '::keystone::db::mysql': } class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone', catalog_type => 'sql', diff --git a/examples/ldap_backend.pp b/examples/ldap_backend.pp index 5c5b7f1bc..a4360463f 100644 --- a/examples/ldap_backend.pp +++ b/examples/ldap_backend.pp @@ -1,5 +1,4 @@ class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone', admin_token => 'admin_token', diff --git a/examples/v3_basic.pp b/examples/v3_basic.pp index 5777d2b5b..3ca57b8fc 100644 --- a/examples/v3_basic.pp +++ b/examples/v3_basic.pp @@ -27,7 +27,6 @@ class { '::keystone::db::mysql': password => 'keystone', } class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone', admin_token => 'admin_token', diff --git a/examples/v3_domain_configuration.pp b/examples/v3_domain_configuration.pp index 6b6e4d9a6..ae3537590 100644 --- a/examples/v3_domain_configuration.pp +++ b/examples/v3_domain_configuration.pp @@ -10,7 +10,6 @@ class { '::keystone::db::mysql': password => 'keystone', } class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:keystone@192.168.1.1/keystone', admin_token => 'admin_token', diff --git a/manifests/init.pp b/manifests/init.pp index 2c7f51fe1..4f6bfd9b5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -25,10 +25,6 @@ # Admin token that can be used to authenticate as a keystone # admin. Required. # -# [*verbose*] -# (optional) Rather keystone should log at verbose level. -# Defaults to undef. -# # [*debug*] # (optional) Rather keystone should log at debug level. # Defaults to undef. @@ -542,13 +538,16 @@ # [*service_provider*] # (optional) DEPRECATED. Provider, that can be used for keystone service. # +# [*verbose*] +# (optional) DEPRECATED. Rather keystone should log at verbose level. +# Defaults to undef. +# # == Dependencies # None # # == Examples # # class { 'keystone': -# log_verbose => 'True', # admin_token => 'my_special_token', # } # @@ -579,7 +578,6 @@ class keystone( $admin_bind_host = '0.0.0.0', $public_port = '5000', $admin_port = '35357', - $verbose = undef, $debug = undef, $log_dir = undef, $log_file = undef, @@ -678,6 +676,7 @@ class keystone( $admin_workers = max($::processorcount, 2), $public_workers = max($::processorcount, 2), $service_provider = undef, + $verbose = undef, ) inherits keystone::params { include ::keystone::deps @@ -687,6 +686,10 @@ class keystone( warning('service_provider is deprecated, does nothing and will be removed in a future release, use a Puppet resource collector if you want to modify the service provider.') } + if $verbose { + warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') + } + if ! $catalog_driver { validate_re($catalog_type, 'template|sql') } diff --git a/manifests/logging.pp b/manifests/logging.pp index fa721f4e5..869c3c2dd 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 @@ -106,7 +102,12 @@ # (Optional) Uses logging handler designed to watch file system (boolean value). # Defaults to $::os_service_default # - +# DEPRECATED +# +# [*verbose*] +# (Optional) Deprecated. Should the daemons log verbose messages +# Defaults to undef. +# class keystone::logging( $use_syslog = $::os_service_default, @@ -114,7 +115,6 @@ class keystone::logging( $log_facility = $::os_service_default, $log_dir = '/var/log/keystone', $log_file = $::os_service_default, - $verbose = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -129,10 +129,16 @@ class keystone::logging( $instance_uuid_format = $::os_service_default, $log_date_format = $::os_service_default, $watch_log_file = $::os_service_default, + # DEPRECATED + $verbose = undef, ) { include ::keystone::deps + 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 keystone:: first then keystone::logging::. $use_syslog_real = pick($::keystone::use_syslog,$use_syslog) @@ -140,12 +146,10 @@ class keystone::logging( $log_facility_real = pick($::keystone::log_facility,$log_facility) $log_dir_real = pick($::keystone::log_dir,$log_dir) $log_file_real = pick($::keystone::log_file,$log_file) - $verbose_real = pick($::keystone::verbose,$verbose) $debug_real = pick($::keystone::debug,$debug) oslo::log { 'keystone_config': debug => $debug_real, - verbose => $verbose_real, log_config_append => $log_config_append, log_date_format => $log_date_format, log_file => $log_file_real, diff --git a/releasenotes/notes/verbose-deprecation-38d9b7667fcf381d.yaml b/releasenotes/notes/verbose-deprecation-38d9b7667fcf381d.yaml new file mode 100644 index 000000000..ecfc2567f --- /dev/null +++ b/releasenotes/notes/verbose-deprecation-38d9b7667fcf381d.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - verbose option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/classes/keystone_logging_spec.rb b/spec/classes/keystone_logging_spec.rb index ea791a283..06bee8862 100644 --- a/spec/classes/keystone_logging_spec.rb +++ b/spec/classes/keystone_logging_spec.rb @@ -28,7 +28,6 @@ describe 'keystone::logging' do :log_facility => 'LOG_FOO', :log_dir => '/var/log', :log_file => '/var/tmp/keystone_random.log', - :verbose => true, :debug => true, } end @@ -39,7 +38,6 @@ describe 'keystone::logging' do is_expected.to contain_keystone_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_keystone_config('DEFAULT/log_dir').with(:value => '/var/log/keystone') is_expected.to contain_keystone_config('DEFAULT/log_file').with(:value => '') - is_expected.to contain_keystone_config('DEFAULT/verbose').with(:value => '') is_expected.to contain_keystone_config('DEFAULT/debug').with(:value => '') end end @@ -51,7 +49,6 @@ describe 'keystone::logging' do is_expected.to contain_keystone_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO') is_expected.to contain_keystone_config('DEFAULT/log_dir').with(:value => '/var/log') is_expected.to contain_keystone_config('DEFAULT/log_file').with(:value => '/var/tmp/keystone_random.log') - is_expected.to contain_keystone_config('DEFAULT/verbose').with(:value => 'true') is_expected.to contain_keystone_config('DEFAULT/debug').with(:value => 'true') end end diff --git a/spec/classes/keystone_spec.rb b/spec/classes/keystone_spec.rb index 332b8def7..b19851822 100644 --- a/spec/classes/keystone_spec.rb +++ b/spec/classes/keystone_spec.rb @@ -27,7 +27,6 @@ describe 'keystone' do 'admin_bind_host' => '0.0.0.0', 'public_port' => '5000', 'admin_port' => '35357', - 'verbose' => false, 'debug' => false, 'use_stderr' => true, 'catalog_type' => 'sql', @@ -76,7 +75,6 @@ describe 'keystone' do 'public_port' => '5001', 'admin_port' => '35358', 'admin_token' => 'service_token_override', - 'verbose' => true, 'debug' => true, 'use_stderr' => false, 'catalog_type' => 'template', @@ -157,7 +155,6 @@ describe 'keystone' do 'admin_bind_host', 'public_port', 'admin_port', - 'verbose', 'debug', 'use_stderr' ].each do |config| diff --git a/tests/site.pp b/tests/site.pp index c3a3fbb90..2241351fb 100644 --- a/tests/site.pp +++ b/tests/site.pp @@ -7,7 +7,6 @@ package { 'curl': ensure => present } # with all of the default admin roles node 'keystone_sqlite' { class { '::keystone': - verbose => true, debug => true, catalog_type => 'sql', admin_token => 'admin_token', @@ -28,7 +27,6 @@ node keystone_mysql { password => 'keystone', } class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone', catalog_type => 'sql', @@ -44,7 +42,6 @@ node keystone_mysql { # keystone with mysql on another node node keystone { class { '::keystone': - verbose => true, debug => true, database_connection => 'mysql://keystone:password@127.0.0.1/keystone', catalog_type => 'sql',