Use oslo module to configure the common parameters

The lock_path parameter and logging options are configured
using puppet-oslo module

Additional changes:

* add dependencies and version of the oslo package in
  metadata.json file
* add a release note for switching tempest to use
  puppet-oslo module

Change-Id: I9ac9484d453290b855625ed5103cd64b3cebe862
This commit is contained in:
ZhongShengping 2016-05-09 14:48:42 +08:00
parent b21e1b7299
commit fd4da1ad15
4 changed files with 25 additions and 15 deletions

View File

@ -39,16 +39,16 @@
# Defaults to undef
# [*lock_path*]
# Defaults to '/var/lib/tempest'
# [*log_file*]
# Defaults to $::os_service_default
# [*debug*]
# Defaults to false
# [*use_stderr*]
# Defaults to true
# [*use_syslog*]
# Defaults to false
# [*log_file*]
# Defaults to undef
# [*logging_context_format_string*]
# Defaults to undef
# Defaults to $::os_service_default
# [*username*]
# Defaults to undef
# [*password*]
@ -158,6 +158,7 @@
# DEPREACTED PARAMETERS
# [*verbose*]
# Defaults to false
#
class tempest(
$install_from_source = true,
$git_clone = true,
@ -193,11 +194,11 @@ class tempest(
$identity_uri_v3 = undef,
$cli_dir = undef,
$lock_path = '/var/lib/tempest',
$log_file = $::os_service_default,
$debug = false,
$use_stderr = true,
$use_syslog = false,
$log_file = undef,
$logging_context_format_string = undef,
$logging_context_format_string = $::os_service_default,
# non admin user
$username = undef,
$password = undef,
@ -264,7 +265,7 @@ class tempest(
) {
if $verbose {
warning('verbose is deprecated and does nothing. Will be remove in a future release.')
warning('verbose is deprecated and does nothing. Will be removed in a future release.')
}
include ::tempest::params
@ -380,17 +381,21 @@ class tempest(
'service_available/zaqar': value => $zaqar_available;
'whitebox/db_uri': value => $whitebox_db_uri;
'cli/cli_dir': value => $cli_dir;
'oslo_concurrency/lock_path': value => $lock_path;
'DEFAULT/debug': value => $debug;
'DEFAULT/use_stderr': value => $use_stderr;
'DEFAULT/use_syslog': value => $use_syslog;
'DEFAULT/log_file': value => $log_file;
'DEFAULT/logging_context_format_string': value => $logging_context_format_string;
'scenario/img_dir': value => $img_dir;
'scenario/img_file': value => $img_file;
'service_broker/run_service_broker_tests': value => $run_service_broker_tests;
}
oslo::concurrency { 'tempest_config': lock_path => $lock_path }
oslo::log { 'tempest_config':
debug => $debug,
log_file => $log_file,
use_stderr => $use_stderr,
use_syslog => $use_syslog,
logging_context_format_string => $logging_context_format_string
}
if $manage_tests_packages {
if $aodh_available and $::tempest::params::python_aodh_tests {
package { 'python-aodh-tests':

View File

@ -34,6 +34,7 @@
{ "name": "puppetlabs/inifile", "version_requirement": ">=1.0.0 <2.0.0" },
{ "name": "puppetlabs/stdlib", "version_requirement": ">=4.0.0 <5.0.0" },
{ "name": "puppetlabs/vcsrepo", "version_requirement": ">=0.1.2 <2.0.0"},
{ "name": "openstack/openstacklib", "version_requirement": ">= 8.0.0 <9.0.0" }
{ "name": "openstack/openstacklib", "version_requirement": ">= 8.0.0 <9.0.0" },
{ "name": "openstack/oslo", "version_requirement": "<9.0.0" }
]
}

View File

@ -0,0 +1,4 @@
---
features:
- Switch to puppet-oslo resource usage (instead of
manual configuration file editing).

View File

@ -221,10 +221,10 @@ describe 'tempest' do
is_expected.to contain_tempest_config('cli/cli_dir').with(:value => nil)
is_expected.to contain_tempest_config('oslo_concurrency/lock_path').with(:value => '/var/lib/tempest')
is_expected.to contain_tempest_config('DEFAULT/debug').with(:value => false)
is_expected.to contain_tempest_config('DEFAULT/log_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tempest_config('DEFAULT/use_stderr').with(:value => true)
is_expected.to contain_tempest_config('DEFAULT/use_syslog').with(:value => false)
is_expected.to contain_tempest_config('DEFAULT/log_file').with(:value => nil)
is_expected.to contain_tempest_config('DEFAULT/logging_context_format_string').with(:value => nil)
is_expected.to contain_tempest_config('DEFAULT/logging_context_format_string').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tempest_config('scenario/img_dir').with(:value => '/var/lib/tempest')
is_expected.to contain_tempest_config('scenario/img_file').with(:value => 'cirros-0.3.4-x86_64-disk.img')
is_expected.to contain_tempest_config('service_broker/run_service_broker_tests').with(:value => false)