Deprecate nova::logging params in ::nova
Deprecates the parameters in ::nova that should be set
directly in the ::nova::logging class.
We can then remove all the messy pick() calls and backward
compatibility when this has been deprecated for a cycle. [1] [2]
[1] e211fcfd65/manifests/logging.pp (L122-L130)
[2] https://github.com/openstack/puppet-nova/blob/master/manifests/init.pp#L531
Change-Id: I0fb2def264bd72101612291708df26f143183c8a
			
			
This commit is contained in:
		@@ -221,11 +221,6 @@
 | 
				
			|||||||
#   (optional) Maximum time since last check-in for up service.
 | 
					#   (optional) Maximum time since last check-in for up service.
 | 
				
			||||||
#   Defaults to 60
 | 
					#   Defaults to 60
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# [*log_dir*]
 | 
					 | 
				
			||||||
#   (optional) Directory where logs should be stored.
 | 
					 | 
				
			||||||
#   If set to $::os_service_default, it will not log to any directory.
 | 
					 | 
				
			||||||
#   Defaults to undef
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# [*state_path*]
 | 
					# [*state_path*]
 | 
				
			||||||
#   (optional) Directory for storing state.
 | 
					#   (optional) Directory for storing state.
 | 
				
			||||||
#   Defaults to '/var/lib/nova'
 | 
					#   Defaults to '/var/lib/nova'
 | 
				
			||||||
@@ -235,10 +230,6 @@
 | 
				
			|||||||
#   On RHEL will be '/var/lib/nova/tmp' and on Debian '/var/lock/nova'
 | 
					#   On RHEL will be '/var/lib/nova/tmp' and on Debian '/var/lock/nova'
 | 
				
			||||||
#   Defaults to $::nova::params::lock_path
 | 
					#   Defaults to $::nova::params::lock_path
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# [*debug*]
 | 
					 | 
				
			||||||
#   (optional) Set log output to debug output.
 | 
					 | 
				
			||||||
#   Defaults to undef
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# [*periodic_interval*]
 | 
					# [*periodic_interval*]
 | 
				
			||||||
#   (optional) Seconds between running periodic tasks.
 | 
					#   (optional) Seconds between running periodic tasks.
 | 
				
			||||||
#   Defaults to '60'
 | 
					#   Defaults to '60'
 | 
				
			||||||
@@ -251,18 +242,6 @@
 | 
				
			|||||||
#   (optional) Path to the rootwrap configuration file to use for running commands as root
 | 
					#   (optional) Path to the rootwrap configuration file to use for running commands as root
 | 
				
			||||||
#   Defaults to '/etc/nova/rootwrap.conf'
 | 
					#   Defaults to '/etc/nova/rootwrap.conf'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# [*use_syslog*]
 | 
					 | 
				
			||||||
#   (optional) Use syslog for logging
 | 
					 | 
				
			||||||
#   Defaults to undef
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# [*use_stderr*]
 | 
					 | 
				
			||||||
#   (optional) Use stderr for logging
 | 
					 | 
				
			||||||
#   Defaults to undef
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# [*log_facility*]
 | 
					 | 
				
			||||||
#   (optional) Syslog facility to receive log lines.
 | 
					 | 
				
			||||||
#   Defaults to undef
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# [*use_ssl*]
 | 
					# [*use_ssl*]
 | 
				
			||||||
#   (optional) Enable SSL on the API server
 | 
					#   (optional) Enable SSL on the API server
 | 
				
			||||||
#   Defaults to false, not set
 | 
					#   Defaults to false, not set
 | 
				
			||||||
@@ -426,6 +405,27 @@
 | 
				
			|||||||
#   exceptions in the API service
 | 
					#   exceptions in the API service
 | 
				
			||||||
#   Defaults to undef
 | 
					#   Defaults to undef
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					# [*use_syslog*]
 | 
				
			||||||
 | 
					#   (optional) Use syslog for logging
 | 
				
			||||||
 | 
					#   Defaults to undef
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# [*use_stderr*]
 | 
				
			||||||
 | 
					#   (optional) Use stderr for logging
 | 
				
			||||||
 | 
					#   Defaults to undef
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# [*log_facility*]
 | 
				
			||||||
 | 
					#   (optional) Syslog facility to receive log lines.
 | 
				
			||||||
 | 
					#   Defaults to undef
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# [*log_dir*]
 | 
				
			||||||
 | 
					#   (optional) Directory where logs should be stored.
 | 
				
			||||||
 | 
					#   If set to $::os_service_default, it will not log to any directory.
 | 
				
			||||||
 | 
					#   Defaults to undef
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# [*debug*]
 | 
				
			||||||
 | 
					#   (optional) Set log output to debug output.
 | 
				
			||||||
 | 
					#   Defaults to undef
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
class nova(
 | 
					class nova(
 | 
				
			||||||
  $ensure_package                         = 'present',
 | 
					  $ensure_package                         = 'present',
 | 
				
			||||||
  $database_connection                    = undef,
 | 
					  $database_connection                    = undef,
 | 
				
			||||||
@@ -480,10 +480,8 @@ class nova(
 | 
				
			|||||||
  $host                                   = $::os_service_default,
 | 
					  $host                                   = $::os_service_default,
 | 
				
			||||||
  $auth_strategy                          = 'keystone',
 | 
					  $auth_strategy                          = 'keystone',
 | 
				
			||||||
  $service_down_time                      = 60,
 | 
					  $service_down_time                      = 60,
 | 
				
			||||||
  $log_dir                                = undef,
 | 
					 | 
				
			||||||
  $state_path                             = '/var/lib/nova',
 | 
					  $state_path                             = '/var/lib/nova',
 | 
				
			||||||
  $lock_path                              = $::nova::params::lock_path,
 | 
					  $lock_path                              = $::nova::params::lock_path,
 | 
				
			||||||
  $debug                                  = undef,
 | 
					 | 
				
			||||||
  $periodic_interval                      = '60',
 | 
					  $periodic_interval                      = '60',
 | 
				
			||||||
  $report_interval                        = '10',
 | 
					  $report_interval                        = '10',
 | 
				
			||||||
  $rootwrap_config                        = '/etc/nova/rootwrap.conf',
 | 
					  $rootwrap_config                        = '/etc/nova/rootwrap.conf',
 | 
				
			||||||
@@ -494,9 +492,6 @@ class nova(
 | 
				
			|||||||
  $key_file                               = false,
 | 
					  $key_file                               = false,
 | 
				
			||||||
  $nova_public_key                        = undef,
 | 
					  $nova_public_key                        = undef,
 | 
				
			||||||
  $nova_private_key                       = undef,
 | 
					  $nova_private_key                       = undef,
 | 
				
			||||||
  $use_syslog                             = undef,
 | 
					 | 
				
			||||||
  $use_stderr                             = undef,
 | 
					 | 
				
			||||||
  $log_facility                           = undef,
 | 
					 | 
				
			||||||
  $notification_transport_url             = $::os_service_default,
 | 
					  $notification_transport_url             = $::os_service_default,
 | 
				
			||||||
  $notification_driver                    = $::os_service_default,
 | 
					  $notification_driver                    = $::os_service_default,
 | 
				
			||||||
  $notification_topics                    = $::os_service_default,
 | 
					  $notification_topics                    = $::os_service_default,
 | 
				
			||||||
@@ -522,13 +517,25 @@ class nova(
 | 
				
			|||||||
  $my_ip                                  = $::os_service_default,
 | 
					  $my_ip                                  = $::os_service_default,
 | 
				
			||||||
  # DEPRECATED PARAMETERS
 | 
					  # DEPRECATED PARAMETERS
 | 
				
			||||||
  $notify_api_faults                      = undef,
 | 
					  $notify_api_faults                      = undef,
 | 
				
			||||||
 | 
					  $use_syslog                             = undef,
 | 
				
			||||||
 | 
					  $use_stderr                             = undef,
 | 
				
			||||||
 | 
					  $log_facility                           = undef,
 | 
				
			||||||
 | 
					  $log_dir                                = undef,
 | 
				
			||||||
 | 
					  $debug                                  = undef,
 | 
				
			||||||
) inherits nova::params {
 | 
					) inherits nova::params {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  include ::nova::deps
 | 
					  include ::nova::deps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # maintain backward compatibility
 | 
					  # maintain backward compatibility
 | 
				
			||||||
  include ::nova::db
 | 
					  include ::nova::db
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # TODO(tobasco): Remove when use_syslog, use_stderr, log_facility, log_dir
 | 
				
			||||||
 | 
					  # and debug parameters is removed from here.
 | 
				
			||||||
  include ::nova::logging
 | 
					  include ::nova::logging
 | 
				
			||||||
 | 
					  if ($use_syslog or $use_stderr or $log_facility or $log_dir or $debug) {
 | 
				
			||||||
 | 
					    warning('nova::use_syslog, nova::use_stderr, nova::log_facility, nova::log_dir \
 | 
				
			||||||
 | 
					and nova::debug is deprecated and has been moved to nova::logging class, please set them there.')
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  validate_array($enabled_ssl_apis)
 | 
					  validate_array($enabled_ssl_apis)
 | 
				
			||||||
  if empty($enabled_ssl_apis) and $use_ssl {
 | 
					  if empty($enabled_ssl_apis) and $use_ssl {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -119,6 +119,7 @@ class nova::logging(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
 | 
					  # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
 | 
				
			||||||
  # to use nova::<myparam> first then nova::logging::<myparam>.
 | 
					  # to use nova::<myparam> first then nova::logging::<myparam>.
 | 
				
			||||||
 | 
					  # TODO(tobasco): Remove these when they have been deprecated for atleast one cycle.
 | 
				
			||||||
  $use_syslog_real = pick($::nova::use_syslog,$use_syslog)
 | 
					  $use_syslog_real = pick($::nova::use_syslog,$use_syslog)
 | 
				
			||||||
  $use_stderr_real = pick($::nova::use_stderr,$use_stderr)
 | 
					  $use_stderr_real = pick($::nova::use_stderr,$use_stderr)
 | 
				
			||||||
  $log_facility_real = pick($::nova::log_facility,$log_facility)
 | 
					  $log_facility_real = pick($::nova::log_facility,$log_facility)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					deprecations:
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    The parameters nova::use_syslog, nova::use_stderr, nova::log_facility, nova::log_dir
 | 
				
			||||||
 | 
					    and nova::debug has been deprecated and moved to the nova::logging class, please use
 | 
				
			||||||
 | 
					    them there.
 | 
				
			||||||
@@ -73,8 +73,7 @@ describe 'nova' do
 | 
				
			|||||||
    context 'with overridden parameters' do
 | 
					    context 'with overridden parameters' do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      let :params do
 | 
					      let :params do
 | 
				
			||||||
        { :debug                                   => true,
 | 
					        {
 | 
				
			||||||
          :log_dir                                 => '/var/log/nova2',
 | 
					 | 
				
			||||||
          :image_service                           => 'nova.image.local.LocalImageService',
 | 
					          :image_service                           => 'nova.image.local.LocalImageService',
 | 
				
			||||||
          :default_transport_url                   => 'rabbit://rabbit_user:password@localhost:5673',
 | 
					          :default_transport_url                   => 'rabbit://rabbit_user:password@localhost:5673',
 | 
				
			||||||
          :rpc_response_timeout                    => '30',
 | 
					          :rpc_response_timeout                    => '30',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user