Merge "Add known_stores option in class glance::api"

This commit is contained in:
Jenkins 2014-04-15 13:13:28 +00:00 committed by Gerrit Code Review
commit e61e47d664
2 changed files with 37 additions and 1 deletions

View File

@ -139,6 +139,12 @@
# Tested versions include 0.9 and 2.2
# Defaults to '0.9'.
#
# [*known_stores*]
# (optional)List of which store classes and store class locations are
# currently known to glance at startup.
# Defaults to false.
# Example: ['glance.store.filesystem.Store','glance.store.http.Store']
#
class glance::api(
$keystone_password,
$verbose = false,
@ -172,6 +178,7 @@ class glance::api(
$key_file = false,
$ca_file = false,
$mysql_module = '0.9',
$known_stores = false,
) inherits glance {
require keystone::python
@ -223,6 +230,17 @@ class glance::api(
'DEFAULT/show_image_direct_url': value => $show_image_direct_url;
}
# known_stores config
if $known_stores {
glance_api_config {
'DEFAULT/known_stores': value => join($known_stores, ',');
}
} else {
glance_api_config {
'DEFAULT/known_stores': ensure => absent;
}
}
glance_cache_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;

View File

@ -34,7 +34,8 @@ describe 'glance::api' do
:sql_connection => 'sqlite:///var/lib/glance/glance.sqlite',
:show_image_direct_url => false,
:purge_config => false,
:mysql_module => '0.9'
:mysql_module => '0.9',
:known_stores => false,
}
end
@ -286,4 +287,21 @@ describe 'glance::api' do
it { should contain_glance_api_config('DEFAULT/key_file').with_value('/tmp/key_file') }
end
end
describe 'with known_stores by default' do
let :params do
default_params
end
it { should_not contain_glance_api_config('DEFAULT/known_stores').with_value('false') }
end
describe 'with known_stores override' do
let :params do
default_params.merge({
:known_stores => ['glance.store.filesystem.Store','glance.store.http.Store'],
})
end
it { should contain_glance_api_config('DEFAULT/known_stores').with_value("glance.store.filesystem.Store,glance.store.http.Store") }
end
end