Switch cinder to use os_service_default fact

This change switches the cinder module to use the os_service_default
fact for configuration options that default to '<SERVICE DEFAULT>'.

Change-Id: I8c28f02794fdc7034a85eab80a66a98f664380ea
Depends-On: Ieeb92b4e7fbb556a8d32682fb24284091227c991
This commit is contained in:
Alex Schultz 2015-09-29 13:24:29 -05:00
parent b8fadd3360
commit 667e6c0850
20 changed files with 95 additions and 71 deletions

View File

@ -40,6 +40,11 @@ Puppet::Type.newtype(:cinder_api_paste_ini) do
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:package) do
'cinder'
end

View File

@ -60,7 +60,7 @@
# (optional) Some operations require cinder to make API requests
# to Nova. This sets the keystone region to be used for these
# requests. For example, boot-from-volume.
# Defaults to '<SERVICE DEFAULT>'.
# Defaults to $::os_service_default
#
# [*nova_catalog_info*]
# (optional) Match this value when searching for nova in the service
@ -128,7 +128,7 @@
# This should contain the name of the default volume type to use.
# If not configured, it produces an error when creating a volume
# without specifying a type.
# Defaults to '<SERVICE DEFAULT>'.
# Defaults to $::os_service_default.
#
# [*validate*]
# (optional) Whether to validate the service is working after any service refreshes
@ -163,7 +163,7 @@ class cinder::api (
$identity_uri = false,
$nova_catalog_info = 'compute:Compute Service:publicURL',
$nova_catalog_admin_info = 'compute:Compute Service:adminURL',
$os_region_name = '<SERVICE DEFAULT>',
$os_region_name = $::os_service_default,
$privileged_user = false,
$os_privileged_user_name = undef,
$os_privileged_user_password = undef,
@ -175,7 +175,7 @@ class cinder::api (
$enabled = true,
$manage_service = true,
$ratelimits = undef,
$default_volume_type = '<SERVICE DEFAULT>',
$default_volume_type = $::os_service_default,
$ratelimits_factory =
'cinder.api.v1.limits:RateLimitingMiddleware.factory',
$validate = false,

View File

@ -112,7 +112,7 @@
# [*nfs_mount_options*]
# (optional) Mount options passed to the nfs client. See section
# of the nfs man page for details.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*netapp_copyoffload_tool_path*]
# (optional) This option specifies the path of the NetApp Copy Offload tool
@ -197,7 +197,7 @@ define cinder::backend::netapp (
$thres_avl_size_perc_stop = '60',
$nfs_shares = undef,
$nfs_shares_config = '/etc/cinder/shares.conf',
$nfs_mount_options = '<SERVICE DEFAULT>',
$nfs_mount_options = $::os_service_default,
$netapp_copyoffload_tool_path = undef,
$netapp_controller_ips = undef,
$netapp_sa_password = undef,

View File

@ -25,12 +25,12 @@
#
# [*rbd_secret_uuid*]
# (optional) A required parameter to use cephx.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*volume_tmp_dir*]
# (optional) Location to store temporary image files if the volume
# driver does not write them directly to the volume
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*rbd_max_clone_depth*]
# (optional) Maximum number of nested clones that can be taken of a
@ -50,8 +50,8 @@ define cinder::backend::rbd (
$volume_backend_name = $name,
$rbd_ceph_conf = '/etc/ceph/ceph.conf',
$rbd_flatten_volume_from_snapshot = false,
$rbd_secret_uuid = '<SERVICE DEFAULT>',
$volume_tmp_dir = '<SERVICE DEFAULT>',
$rbd_secret_uuid = $::os_service_default,
$volume_tmp_dir = $::os_service_default,
$rbd_max_clone_depth = '5',
$extra_options = {},
) {

View File

@ -37,11 +37,11 @@
#
# [*backup_mount_options*]
# (optional) The mount options that are passed to the NFS client.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*backup_container*]
# (optional) Custom container to use for backups.
# Defaults to undef
# Defaults to $::os_service_default
#
# [*backup_compression_algorithm*]
# (optional) Compression algorithm to use when writing backup data.
@ -75,8 +75,8 @@ class cinder::backup::nfs (
$backup_sha_block_size_bytes = 32768,
$backup_enable_progress_timer = true,
$backup_mount_point_base = '$state_path/backup_mount',
$backup_mount_options = '<SERVICE DEFAULT>',
$backup_container = undef,
$backup_mount_options = $::os_service_default,
$backup_container = $::os_service_default,
$backup_compression_algorithm = 'zlib',
) {

View File

@ -10,37 +10,37 @@
#
# [*database_idle_timeout*]
# Timeout when db connections should be reaped.
# (Optional) Defaults to '<SERVICE DEFAULT>'
# (Optional) Defaults to $::os_service_default
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to '<SERVICE DEFAULT>'
# (Optional) Defaults to $::os_service_default
#
# [*database_max_pool_size*]
# Maximum number of SQL connections to keep open in a pool.
# (Optional) Defaults to '<SERVICE DEFAULT>'
# (Optional) Defaults to $::os_service_default
#
# [*database_max_retries*]
# Maximum db connection retries during startup.
# Setting -1 implies an infinite retry count.
# (Optional) Defaults to '<SERVICE DEFAULT>'
# (Optional) Defaults to $::os_service_default
#
# [*database_retry_interval*]
# Interval between retries of opening a sql connection.
# (Optional) Defaults to '<SERVICE DEFAULT>'
# (Optional) Defaults to $::os_service_default
#
# [*database_max_overflow*]
# If set, use this value for max_overflow with sqlalchemy.
# (Optional) Defaults to '<SERVICE DEFAULT>'
# (Optional) Defaults to $::os_service_default
#
class cinder::db (
$database_connection = 'sqlite:////var/lib/cinder/cinder.sqlite',
$database_idle_timeout = '<SERVICE DEFAULT>',
$database_min_pool_size = '<SERVICE DEFAULT>',
$database_max_pool_size = '<SERVICE DEFAULT>',
$database_max_retries = '<SERVICE DEFAULT>',
$database_retry_interval = '<SERVICE DEFAULT>',
$database_max_overflow = '<SERVICE DEFAULT>',
$database_idle_timeout = $::os_service_default,
$database_min_pool_size = $::os_service_default,
$database_max_pool_size = $::os_service_default,
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
) {
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function

View File

@ -75,21 +75,21 @@
#
# [*kombu_ssl_ca_certs*]
# (optional) SSL certification authority file (valid only if SSL enabled).
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*kombu_ssl_certfile*]
# (optional) SSL cert file (valid only if SSL enabled).
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*kombu_ssl_keyfile*]
# (optional) SSL key file (valid only if SSL enabled).
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*amqp_durable_queues*]
# Use durable queues in amqp.
@ -183,7 +183,7 @@
# [*log_dir*]
# (optional) Directory where logs should be stored.
# If set to boolean false, it will not log to any directory.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*use_ssl*]
# (optional) Enable SSL on the API server
@ -199,7 +199,7 @@
#
# [*ca_file*]
# (optional) CA certificate file to use to verify connecting clients
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*storage_availability_zone*]
# (optional) Availability zone of the node.
@ -253,10 +253,10 @@ class cinder (
$rabbit_userid = 'guest',
$rabbit_password = false,
$rabbit_use_ssl = false,
$kombu_ssl_ca_certs = '<SERVICE DEFAULT>',
$kombu_ssl_certfile = '<SERVICE DEFAULT>',
$kombu_ssl_keyfile = '<SERVICE DEFAULT>',
$kombu_ssl_version = '<SERVICE DEFAULT>',
$kombu_ssl_ca_certs = $::os_service_default,
$kombu_ssl_certfile = $::os_service_default,
$kombu_ssl_keyfile = $::os_service_default,
$kombu_ssl_version = $::os_service_default,
$amqp_durable_queues = false,
$qpid_hostname = 'localhost',
$qpid_port = '5672',
@ -274,14 +274,14 @@ class cinder (
$qpid_tcp_nodelay = true,
$package_ensure = 'present',
$use_ssl = false,
$ca_file = '<SERVICE DEFAULT>',
$ca_file = $::os_service_default,
$cert_file = false,
$key_file = false,
$api_paste_config = '/etc/cinder/api-paste.ini',
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$log_dir = '<SERVICE DEFAULT>',
$log_dir = $::os_service_default,
$verbose = false,
$debug = false,
$storage_availability_zone = 'nova',

View File

@ -6,29 +6,29 @@
#
# [*logging_context_format_string*]
# (Optional) Format string to use for log messages with context.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
#
# [*logging_default_format_string*]
# (Optional) Format string to use for log messages without context.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [-] %(instance)s%(message)s'
#
# [*logging_debug_format_suffix*]
# (Optional) Formatted data to append to log format when level is DEBUG.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# Example: '%(funcName)s %(pathname)s:%(lineno)d'
#
# [*logging_exception_prefix*]
# (Optional) Prefix each line of exception output with this format.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
#
# [*log_config_append*]
# The name of an additional logging configuration file.
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# See https://docs.python.org/2/howto/logging.html
#
# [*default_log_levels*]
@ -42,41 +42,41 @@
#
# [*publish_errors*]
# (optional) Publish error events (boolean value).
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*fatal_deprecations*]
# (optional) Make deprecations fatal (boolean value)
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
#
# [*instance_format*]
# (optional) If an instance is passed with the log message, format it
# like this (string value).
# Defaults to '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# Example: '[instance: %(uuid)s] '
#
# [*instance_uuid_format*]
# (optional) If an instance UUID is passed with the log message, format
# it like this (string value).
# Defaults to '<SERVICE DEFAULT>'
# 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 '<SERVICE DEFAULT>'
# Defaults to $::os_service_default
# Example: 'Y-%m-%d %H:%M:%S'
#
class cinder::logging(
$logging_context_format_string = '<SERVICE DEFAULT>',
$logging_default_format_string = '<SERVICE DEFAULT>',
$logging_debug_format_suffix = '<SERVICE DEFAULT>',
$logging_exception_prefix = '<SERVICE DEFAULT>',
$log_config_append = '<SERVICE DEFAULT>',
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = $::os_service_default,
$logging_exception_prefix = $::os_service_default,
$log_config_append = $::os_service_default,
$default_log_levels = undef,
$publish_errors = '<SERVICE DEFAULT>',
$fatal_deprecations = '<SERVICE DEFAULT>',
$instance_format = '<SERVICE DEFAULT>',
$instance_uuid_format = '<SERVICE DEFAULT>',
$log_date_format = '<SERVICE DEFAULT>',
$publish_errors = $::os_service_default,
$fatal_deprecations = $::os_service_default,
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
) {
cinder_config {

View File

@ -6,7 +6,7 @@
#
# [*scheduler_driver*]
# (Optional) Default scheduler driver to use
# Defaults to '<SERVICE DEFAULT>'.
# Defaults to $::os_service_default.
#
# [*package_ensure*]
# (Optioanl) The state of the package.
@ -22,7 +22,7 @@
#
#
class cinder::scheduler (
$scheduler_driver = '<SERVICE DEFAULT>',
$scheduler_driver = $::os_service_default,
$package_ensure = 'present',
$enabled = true,
$manage_service = true

View File

@ -6,8 +6,10 @@ describe 'cinder::api' do
{:keystone_password => 'foo'}
end
let :facts do
{:osfamily => 'Debian',
:processorcount => 8 }
@default_facts.merge!({
:osfamily => 'Debian',
:processorcount => 8
})
end
describe 'with only required params' do

View File

@ -37,6 +37,8 @@ describe 'cinder::backup::nfs' do
:backup_sha_block_size_bytes => 32768,
:backup_enable_progress_timer => true,
:backup_mount_point_base => '$state_path/backup_mount',
:backup_mount_options => '<SERVICE DEFAULT>',
:backup_container => '<SERVICE DEFAULT>',
:backup_compression_algorithm => 'zlib',
}
end
@ -67,7 +69,7 @@ describe 'cinder::backup::nfs' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge!({:osfamily => 'Debian'})
end
it_configures 'cinder backup with nfs'
@ -75,7 +77,7 @@ describe 'cinder::backup::nfs' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge!({:osfamily => 'RedHat'})
end
it_configures 'cinder backup with nfs'

View File

@ -43,7 +43,7 @@ describe 'cinder::db' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge!({ :osfamily => 'Debian' })
end
it_configures 'cinder::db'
@ -51,7 +51,7 @@ describe 'cinder::db' do
context 'on Redhat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge!({ :osfamily => 'RedHat' })
end
it_configures 'cinder::db'

View File

@ -74,7 +74,7 @@ describe 'cinder::logging' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge!({ :osfamily => 'Debian' })
end
it_configures 'cinder-logging'
@ -82,7 +82,7 @@ describe 'cinder::logging' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge!({ :osfamily => 'RedHat' })
end
it_configures 'cinder-logging'

View File

@ -5,7 +5,7 @@ describe 'cinder::scheduler' do
describe 'on debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge!({ :osfamily => 'Debian' })
end
describe 'with default parameters' do

View File

@ -9,7 +9,7 @@ describe 'cinder' do
end
let :facts do
{:osfamily => 'Debian'}
@default_facts.merge!({:osfamily => 'Debian'})
end
describe 'with only required params' do

View File

@ -2,6 +2,10 @@ require 'spec_helper'
describe 'cinder::volume::netapp' do
let :facts do
@default_facts.merge!({})
end
let :params do
{
:netapp_login => 'netapp',

View File

@ -7,7 +7,7 @@ describe 'cinder::volume' do
end
let :facts do
{:osfamily => 'Debian'}
@default_facts.merge!({:osfamily => 'Debian'})
end
it { is_expected.to contain_package('cinder-volume').with_ensure('present') }

View File

@ -4,6 +4,10 @@ describe 'cinder::backend::netapp' do
let(:title) {'netapp'}
let :facts do
@default_facts.merge!({})
end
let :params do
{
:volume_backend_name => 'netapp-cdot-nfs',

View File

@ -4,6 +4,10 @@ describe 'cinder::backend::rbd' do
let(:title) {'rbd-ssd'}
let :facts do
@default_facts.merge!({})
end
let :req_params do
{
:volume_backend_name => 'rbd-ssd',

View File

@ -5,6 +5,9 @@ require 'webmock/rspec'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
c.before :each do
@default_facts = { :os_service_default => '<SERVICE DEFAULT>' }
end
end
at_exit { RSpec::Puppet::Coverage.report! }