Merge "Add support for SQL idle timeout."

This commit is contained in:
Jenkins
2013-07-01 05:32:06 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
# ==Parameters
#
# [sql_connection] Connection url to use to connect to nova sql database.
# [sql_idle_timeout] Timeout before idle sql connections are reaped.
# [image_service] Service used to search for and retrieve images. Optional.
# Defaults to 'nova.image.local.LocalImageService'
# [glance_api_servers] List of addresses for api servers. Optional.
@@ -33,6 +34,7 @@ class nova(
# this is how to query all resources from our clutser
$nova_cluster_id='localcluster',
$sql_connection = false,
$sql_idle_timeout = '3600',
$rpc_backend = 'nova.openstack.common.rpc.impl_kombu',
$image_service = 'nova.image.glance.GlanceImageService',
# these glance params should be optional
@@ -153,7 +155,8 @@ class nova(
fail("Invalid db connection ${sql_connection}")
}
nova_config {
'DEFAULT/sql_connection': value => $sql_connection, secret => true,
'DEFAULT/sql_connection': value => $sql_connection, secret => true;
'DEFAULT/sql_idle_timeout': value => $sql_idle_timeout;
}
}

View File

@@ -55,6 +55,7 @@ describe 'nova' do
)}
it { should_not contain_nova_config('DEFAULT/sql_connection') }
it { should_not contain_nova_config('DEFAULT/sql_idle_timeout').with_value('3600') }
it { should contain_nova_config('DEFAULT/image_service').with_value('nova.image.glance.GlanceImageService') }
it { should contain_nova_config('DEFAULT/glance_api_servers').with_value('localhost:9292') }
@@ -86,6 +87,7 @@ describe 'nova' do
let :params do
{
'sql_connection' => 'mysql://user:pass@db/db',
'sql_idle_timeout' => '30',
'verbose' => true,
'debug' => true,
'logdir' => '/var/log/nova2',
@@ -106,6 +108,7 @@ describe 'nova' do
it { should contain_package('nova-common').with('ensure' => '2012.1.1-15.el6') }
it { should contain_package('python-nova').with('ensure' => '2012.1.1-15.el6') }
it { should contain_nova_config('DEFAULT/sql_connection').with_value('mysql://user:pass@db/db').with_secret(true) }
it { should contain_nova_config('DEFAULT/sql_idle_timeout').with_value('30') }
it { should contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService') }
it { should_not contain_nova_config('DEFAULT/glance_api_servers') }
@@ -152,6 +155,7 @@ describe 'nova' do
let :params do
{
'sql_connection' => 'mysql://user:pass@db/db',
'sql_idle_timeout' => '30',
'verbose' => true,
'debug' => true,
'logdir' => '/var/log/nova2',
@@ -168,6 +172,7 @@ describe 'nova' do
it { should contain_package('nova-common').with('ensure' => '2012.1.1-15.el6') }
it { should contain_package('python-nova').with('ensure' => '2012.1.1-15.el6') }
it { should contain_nova_config('DEFAULT/sql_connection').with_value('mysql://user:pass@db/db') }
it { should contain_nova_config('DEFAULT/sql_idle_timeout').with_value('30') }
it { should contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService') }
it { should_not contain_nova_config('DEFAULT/glance_api_servers') }