$::os_service_default in db and logging
Switch to $::os_service_default all params in logging and db. Changes: logging.pp, db.pp and tests. Related-bug: #1515273 Change-Id: Ib84dceafb032747adc1d8b6e56bd01e89aa802cb
This commit is contained in:
parent
8a0ac0e6a4
commit
4b87767b3b
@ -1,4 +1,4 @@
|
||||
# == Class: keystone::db
|
||||
# class: keystone::db
|
||||
#
|
||||
# Configure the Keystone database
|
||||
#
|
||||
@ -10,37 +10,37 @@
|
||||
#
|
||||
# [*database_idle_timeout*]
|
||||
# Timeout when db connections should be reaped.
|
||||
# (Optional) Defaults to 3600.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_max_retries*]
|
||||
# Maximum number of database connection retries during startup.
|
||||
# Setting -1 implies an infinite retry count.
|
||||
# (Optional) Defaults to 10.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_retry_interval*]
|
||||
# Interval between retries of opening a database connection.
|
||||
# (Optional) Defaults to 10.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_min_pool_size*]
|
||||
# Minimum number of SQL connections to keep open in a pool.
|
||||
# (Optional) Defaults to 1.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_max_pool_size*]
|
||||
# Maximum number of SQL connections to keep open in a pool.
|
||||
# (Optional) Defaults to 10.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_max_overflow*]
|
||||
# If set, use this value for max_overflow with sqlalchemy.
|
||||
# (Optional) Defaults to 20.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
class keystone::db (
|
||||
$database_connection = 'sqlite:////var/lib/keystone/keystone.sqlite',
|
||||
$database_idle_timeout = 3600,
|
||||
$database_min_pool_size = 1,
|
||||
$database_max_pool_size = 10,
|
||||
$database_max_retries = 10,
|
||||
$database_retry_interval = 10,
|
||||
$database_max_overflow = 20,
|
||||
$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,
|
||||
) {
|
||||
|
||||
include ::keystone::params
|
||||
@ -58,46 +58,44 @@ class keystone::db (
|
||||
validate_re($database_connection_real,
|
||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
if $database_connection_real {
|
||||
case $database_connection_real {
|
||||
/^mysql(\+pymysql)?:\/\//: {
|
||||
require 'mysql::bindings'
|
||||
require 'mysql::bindings::python'
|
||||
if $database_connection_real =~ /^mysql\+pymysql/ {
|
||||
$backend_package = $::keystone::params::pymysql_package_name
|
||||
} else {
|
||||
$backend_package = false
|
||||
}
|
||||
}
|
||||
/^postgresql:\/\//: {
|
||||
case $database_connection_real {
|
||||
/^mysql(\+pymysql)?:\/\//: {
|
||||
require 'mysql::bindings'
|
||||
require 'mysql::bindings::python'
|
||||
if $database_connection_real =~ /^mysql\+pymysql/ {
|
||||
$backend_package = $::keystone::params::pymysql_package_name
|
||||
} else {
|
||||
$backend_package = false
|
||||
require 'postgresql::lib::python'
|
||||
}
|
||||
/^sqlite:\/\//: {
|
||||
$backend_package = $::keystone::params::sqlite_package_name
|
||||
}
|
||||
default: {
|
||||
fail('Unsupported backend configured')
|
||||
}
|
||||
}
|
||||
|
||||
if $backend_package and !defined(Package[$backend_package]) {
|
||||
package {'keystone-backend-package':
|
||||
ensure => present,
|
||||
name => $backend_package,
|
||||
tag => 'openstack',
|
||||
}
|
||||
/^postgresql:\/\//: {
|
||||
$backend_package = false
|
||||
require 'postgresql::lib::python'
|
||||
}
|
||||
|
||||
keystone_config {
|
||||
'database/connection': value => $database_connection_real, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout_real;
|
||||
'database/min_pool_size': value => $database_min_pool_size_real;
|
||||
'database/max_retries': value => $database_max_retries_real;
|
||||
'database/retry_interval': value => $database_retry_interval_real;
|
||||
'database/max_pool_size': value => $database_max_pool_size_real;
|
||||
'database/max_overflow': value => $database_max_overflow_real;
|
||||
/^sqlite:\/\//: {
|
||||
$backend_package = $::keystone::params::sqlite_package_name
|
||||
}
|
||||
default: {
|
||||
fail('Unsupported backend configured')
|
||||
}
|
||||
}
|
||||
|
||||
if $backend_package and !defined(Package[$backend_package]) {
|
||||
package {'keystone-backend-package':
|
||||
ensure => present,
|
||||
name => $backend_package,
|
||||
tag => 'openstack',
|
||||
}
|
||||
}
|
||||
|
||||
keystone_config {
|
||||
'database/connection': value => $database_connection_real, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout_real;
|
||||
'database/min_pool_size': value => $database_min_pool_size_real;
|
||||
'database/max_retries': value => $database_max_retries_real;
|
||||
'database/retry_interval': value => $database_retry_interval_real;
|
||||
'database/max_pool_size': value => $database_max_pool_size_real;
|
||||
'database/max_overflow': value => $database_max_overflow_real;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,23 +6,23 @@
|
||||
#
|
||||
# [*verbose*]
|
||||
# (Optional) Should the daemons log verbose messages
|
||||
# Defaults to 'false'
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*debug*]
|
||||
# (Optional) Should the daemons log debug messages
|
||||
# Defaults to 'false'
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*use_syslog*]
|
||||
# (Optional) Use syslog for logging.
|
||||
# Defaults to 'false'
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*use_stderr*]
|
||||
# (optional) Use stderr for logging
|
||||
# Defaults to 'true'
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*log_facility*]
|
||||
# (Optional) Syslog facility to receive log lines.
|
||||
# Defaults to 'LOG_USER'
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*log_dir*]
|
||||
# (optional) Directory where logs should be stored.
|
||||
@ -31,38 +31,38 @@
|
||||
#
|
||||
# [*log_file*]
|
||||
# (optional) File where logs should be stored.
|
||||
# Defaults to false.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*logging_context_format_string*]
|
||||
# (optional) Format string to use for log messages with context.
|
||||
# Defaults to undef.
|
||||
# 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 undef.
|
||||
# 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 undef.
|
||||
# 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 undef.
|
||||
# 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 undef.
|
||||
# Defaults to $::os_service_default
|
||||
# See https://docs.python.org/2/howto/logging.html
|
||||
#
|
||||
# [*default_log_levels*]
|
||||
# (optional) Hash of logger (keys) and level (values) pairs.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example:
|
||||
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
||||
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
||||
@ -74,48 +74,48 @@
|
||||
#
|
||||
# [*publish_errors*]
|
||||
# (optional) Publish error events (boolean value).
|
||||
# Defaults to undef (false if unconfigured).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*fatal_deprecations*]
|
||||
# (optional) Make deprecations fatal (boolean value)
|
||||
# Defaults to undef (false if unconfigured).
|
||||
# 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 undef.
|
||||
# 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 undef.
|
||||
# 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 undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: 'Y-%m-%d %H:%M:%S'
|
||||
|
||||
class keystone::logging(
|
||||
$use_syslog = false,
|
||||
$use_stderr = true,
|
||||
$log_facility = 'LOG_USER',
|
||||
$use_syslog = $::os_service_default,
|
||||
$use_stderr = $::os_service_default,
|
||||
$log_facility = $::os_service_default,
|
||||
$log_dir = '/var/log/keystone',
|
||||
$log_file = false,
|
||||
$verbose = false,
|
||||
$debug = false,
|
||||
$logging_context_format_string = undef,
|
||||
$logging_default_format_string = undef,
|
||||
$logging_debug_format_suffix = undef,
|
||||
$logging_exception_prefix = undef,
|
||||
$log_config_append = undef,
|
||||
$default_log_levels = undef,
|
||||
$publish_errors = undef,
|
||||
$fatal_deprecations = undef,
|
||||
$instance_format = undef,
|
||||
$instance_uuid_format = undef,
|
||||
$log_date_format = undef,
|
||||
$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,
|
||||
$logging_debug_format_suffix = $::os_service_default,
|
||||
$logging_exception_prefix = $::os_service_default,
|
||||
$log_config_append = $::os_service_default,
|
||||
$default_log_levels = $::os_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,
|
||||
) {
|
||||
|
||||
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
|
||||
@ -128,151 +128,31 @@ class keystone::logging(
|
||||
$verbose_real = pick($::keystone::verbose,$verbose)
|
||||
$debug_real = pick($::keystone::debug,$debug)
|
||||
|
||||
keystone_config {
|
||||
'DEFAULT/debug' : value => $debug_real;
|
||||
'DEFAULT/verbose' : value => $verbose_real;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr_real;
|
||||
'DEFAULT/use_syslog' : value => $use_syslog_real;
|
||||
'DEFAULT/log_dir' : value => $log_dir_real;
|
||||
'DEFAULT/syslog_log_facility': value => $log_facility_real;
|
||||
if is_service_default($default_log_levels) {
|
||||
$default_log_levels_real = $default_log_levels
|
||||
} else {
|
||||
$default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
|
||||
}
|
||||
|
||||
if $log_file_real {
|
||||
keystone_config {
|
||||
'DEFAULT/log_file' :
|
||||
value => $log_file_real;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/log_file' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_context_format_string {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_context_format_string' :
|
||||
value => $logging_context_format_string;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_context_format_string' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_default_format_string {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_default_format_string' :
|
||||
value => $logging_default_format_string;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_default_format_string' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_debug_format_suffix {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_debug_format_suffix' :
|
||||
value => $logging_debug_format_suffix;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_debug_format_suffix' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_exception_prefix {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/logging_exception_prefix' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $log_config_append {
|
||||
keystone_config {
|
||||
'DEFAULT/log_config_append' : value => $log_config_append;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/log_config_append' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $default_log_levels {
|
||||
keystone_config {
|
||||
'DEFAULT/default_log_levels' :
|
||||
value => join(sort(join_keys_to_values($default_log_levels, '=')), ',');
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/default_log_levels' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $publish_errors {
|
||||
keystone_config {
|
||||
'DEFAULT/publish_errors' : value => $publish_errors;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/publish_errors' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $fatal_deprecations {
|
||||
keystone_config {
|
||||
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/fatal_deprecations' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $instance_format {
|
||||
keystone_config {
|
||||
'DEFAULT/instance_format' : value => $instance_format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/instance_format' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $instance_uuid_format {
|
||||
keystone_config {
|
||||
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/instance_uuid_format' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $log_date_format {
|
||||
keystone_config {
|
||||
'DEFAULT/log_date_format' : value => $log_date_format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
keystone_config {
|
||||
'DEFAULT/log_date_format' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
keystone_config {
|
||||
'DEFAULT/use_syslog' : value => $use_syslog_real;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr_real;
|
||||
'DEFAULT/syslog_log_facility' : value => $log_facility_real;
|
||||
'DEFAULT/log_dir' : value => $log_dir_real;
|
||||
'DEFAULT/log_file': value => $log_file_real;
|
||||
'DEFAULT/verbose' : value => $verbose_real;
|
||||
'DEFAULT/debug' : value => $debug_real;
|
||||
'DEFAULT/default_log_levels' : value => $default_log_levels_real;
|
||||
'DEFAULT/logging_context_format_string' : value => $logging_context_format_string;
|
||||
'DEFAULT/logging_default_format_string' : value => $logging_default_format_string;
|
||||
'DEFAULT/logging_debug_format_suffix' : value => $logging_debug_format_suffix;
|
||||
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
|
||||
'DEFAULT/log_config_append' : value => $log_config_append;
|
||||
'DEFAULT/publish_errors' : value => $publish_errors;
|
||||
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
|
||||
'DEFAULT/instance_format' : value => $instance_format;
|
||||
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
|
||||
'DEFAULT/log_date_format' : value => $log_date_format;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
||||
describe 'keystone::cron::token_flush' do
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
end
|
||||
|
||||
let :params do
|
||||
|
@ -10,7 +10,7 @@ describe 'keystone::db::mysql' do
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
end
|
||||
|
||||
let :params do
|
||||
|
@ -12,11 +12,11 @@ describe 'keystone::db::postgresql' do
|
||||
|
||||
context 'on a RedHat osfamily' do
|
||||
let :facts do
|
||||
{
|
||||
@default_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '7.0',
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
context 'with only required parameters' do
|
||||
@ -34,12 +34,12 @@ describe 'keystone::db::postgresql' do
|
||||
|
||||
context 'on a Debian osfamily' do
|
||||
let :facts do
|
||||
{
|
||||
@default_facts.merge({
|
||||
:operatingsystemrelease => '7.8',
|
||||
:operatingsystem => 'Debian',
|
||||
:osfamily => 'Debian',
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
context 'with only required parameters' do
|
||||
|
@ -7,12 +7,12 @@ describe 'keystone::db' do
|
||||
context 'with default parameters' do
|
||||
|
||||
it { is_expected.to contain_keystone_config('database/connection').with_value('sqlite:////var/lib/keystone/keystone.sqlite').with_secret(true) }
|
||||
it { is_expected.to contain_keystone_config('database/idle_timeout').with_value('3600') }
|
||||
it { is_expected.to contain_keystone_config('database/min_pool_size').with_value('1') }
|
||||
it { is_expected.to contain_keystone_config('database/max_pool_size').with_value('10') }
|
||||
it { is_expected.to contain_keystone_config('database/max_overflow').with_value('20') }
|
||||
it { is_expected.to contain_keystone_config('database/max_retries').with_value('10') }
|
||||
it { is_expected.to contain_keystone_config('database/retry_interval').with_value('10') }
|
||||
it { is_expected.to contain_keystone_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_keystone_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_keystone_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_keystone_config('database/max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_keystone_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_keystone_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
|
||||
end
|
||||
|
||||
@ -77,10 +77,10 @@ describe 'keystone::db' do
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian',
|
||||
@default_facts.merge({ :osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => 'jessie',
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
@ -92,9 +92,9 @@ describe 'keystone::db' do
|
||||
|
||||
context 'on Redhat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat',
|
||||
@default_facts.merge({ :osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '7.1',
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
|
@ -15,7 +15,7 @@ describe 'keystone::logging' do
|
||||
:logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
|
||||
:log_config_append => '/etc/keystone/logging.conf',
|
||||
:publish_errors => true,
|
||||
:default_log_levels => {
|
||||
:default_log_levels => {
|
||||
'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
||||
'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
||||
'iso8601' => 'WARN',
|
||||
@ -36,12 +36,12 @@ describe 'keystone::logging' do
|
||||
|
||||
shared_examples 'basic default logging settings' do
|
||||
it 'configures glance logging settins with default values' do
|
||||
is_expected.to contain_keystone_config('DEFAULT/use_syslog').with(:value => 'false')
|
||||
is_expected.to contain_keystone_config('DEFAULT/use_stderr').with(:value => 'true')
|
||||
is_expected.to contain_keystone_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone_config('DEFAULT/log_dir').with(:value => '/var/log/keystone')
|
||||
is_expected.to contain_keystone_config('DEFAULT/log_file').with(:ensure => :absent)
|
||||
is_expected.to contain_keystone_config('DEFAULT/verbose').with(:value => 'false')
|
||||
is_expected.to contain_keystone_config('DEFAULT/debug').with(:value => 'false')
|
||||
is_expected.to contain_keystone_config('DEFAULT/log_file').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
@ -123,13 +123,13 @@ describe 'keystone::logging' do
|
||||
:default_log_levels, :fatal_deprecations,
|
||||
:instance_format, :instance_uuid_format,
|
||||
:log_date_format, ].each { |param|
|
||||
it { is_expected.to contain_keystone_config("DEFAULT/#{param}").with_ensure('absent') }
|
||||
it { is_expected.to contain_keystone_config("DEFAULT/#{param}").with_value('<SERVICE DEFAULT>') }
|
||||
}
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
end
|
||||
|
||||
it_configures 'keystone-logging'
|
||||
@ -137,7 +137,7 @@ describe 'keystone::logging' do
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
it_configures 'keystone-logging'
|
||||
|
@ -25,7 +25,7 @@ describe 'keystone::policy' do
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
end
|
||||
|
||||
it_configures 'keystone policies'
|
||||
@ -33,7 +33,7 @@ describe 'keystone::policy' do
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
it_configures 'keystone policies'
|
||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
||||
describe 'keystone::python' do
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
end
|
||||
|
||||
it { is_expected.to contain_package('python-keystone').with_ensure("present") }
|
||||
|
@ -11,12 +11,12 @@ describe 'keystone' do
|
||||
end
|
||||
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '7.0',
|
||||
:processorcount => '1'
|
||||
})
|
||||
}))
|
||||
end
|
||||
|
||||
default_params = {
|
||||
@ -735,10 +735,10 @@ describe 'keystone' do
|
||||
|
||||
describe 'setting service_provider' do
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '6.0'
|
||||
})
|
||||
}))
|
||||
end
|
||||
|
||||
describe 'with default service_provider' do
|
||||
@ -807,10 +807,10 @@ describe 'keystone' do
|
||||
|
||||
describe 'with default paste config on RedHat' do
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '6.0'
|
||||
})
|
||||
}))
|
||||
end
|
||||
let :params do
|
||||
default_params
|
||||
@ -881,10 +881,10 @@ describe 'keystone' do
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '7.0'
|
||||
})
|
||||
}))
|
||||
end
|
||||
|
||||
let :platform_parameters do
|
||||
@ -900,11 +900,11 @@ describe 'keystone' do
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '7.0'
|
||||
})
|
||||
}))
|
||||
end
|
||||
|
||||
let :platform_parameters do
|
||||
|
@ -269,10 +269,10 @@ describe 'keystone::wsgi::apache' do
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '6.0'
|
||||
})
|
||||
}))
|
||||
end
|
||||
|
||||
let :platform_parameters do
|
||||
@ -289,11 +289,11 @@ describe 'keystone::wsgi::apache' do
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
global_facts.merge({
|
||||
@default_facts.merge(global_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '7.0'
|
||||
})
|
||||
}))
|
||||
end
|
||||
|
||||
let :platform_parameters do
|
||||
|
@ -182,7 +182,7 @@ describe 'keystone::resource::authtoken' do
|
||||
|
||||
context 'on a Debian osfamily' do
|
||||
let :facts do
|
||||
{ :osfamily => "Debian" }
|
||||
@default_facts.merge({ :osfamily => "Debian" })
|
||||
end
|
||||
|
||||
include_examples 'shared examples'
|
||||
@ -190,7 +190,7 @@ describe 'keystone::resource::authtoken' do
|
||||
|
||||
context 'on a RedHat osfamily' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
include_examples 'shared examples'
|
||||
|
@ -141,7 +141,7 @@ describe 'keystone::resource::service_identity' do
|
||||
|
||||
context 'on a Debian osfamily' do
|
||||
let :facts do
|
||||
{ :osfamily => "Debian" }
|
||||
@default_facts.merge({ :osfamily => "Debian" })
|
||||
end
|
||||
|
||||
include_examples 'keystone::resource::service_identity examples'
|
||||
@ -149,7 +149,7 @@ describe 'keystone::resource::service_identity' do
|
||||
|
||||
context 'on a RedHat osfamily' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
include_examples 'keystone::resource::service_identity examples'
|
||||
|
@ -7,6 +7,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! }
|
||||
|
Loading…
x
Reference in New Issue
Block a user