Merge "Update glance::backend::rbd options"

This commit is contained in:
Jenkins 2013-09-18 06:55:45 +00:00 committed by Gerrit Code Review
commit 9c1d02dffa
2 changed files with 26 additions and 8 deletions

View File

@ -4,19 +4,26 @@
#
# $rbd_store_user - Optional.
#
# $rbd_store_pool - Optional. Default:'images',
# $rbd_store_pool - Optional. Default:'images'
#
# $rbd_store_ceph_conf - Optional. Default:'/etc/ceph/ceph.conf'
#
# $rbd_store_chunk_size - Optional. Default:'8'
class glance::backend::rbd(
$rbd_store_user = undef,
$rbd_store_pool = 'images',
$rbd_store_user = undef,
$rbd_store_ceph_conf = '/etc/ceph/ceph.conf',
$rbd_store_pool = 'images',
$rbd_store_chunk_size = '8',
) {
include glance::params
glance_api_config {
'DEFAULT/default_store': value => 'rbd';
'DEFAULT/rbd_store_user': value => $rbd_store_user;
'DEFAULT/rbd_store_pool': value => $rbd_store_pool;
'DEFAULT/default_store': value => 'rbd';
'DEFAULT/rbd_store_ceph_conf': value => $rbd_store_ceph_conf;
'DEFAULT/rbd_store_user': value => $rbd_store_user;
'DEFAULT/rbd_store_pool': value => $rbd_store_pool;
'DEFAULT/rbd_store_chunk_size': value => $rbd_store_chunk_size;
}
package { 'python-ceph':

View File

@ -9,13 +9,14 @@ describe 'glance::backend::rbd' do
let :params do
{
:rbd_store_user => 'user',
:rbd_store_user => 'glance',
}
end
it { should contain_glance_api_config('DEFAULT/default_store').with_value('rbd') }
it { should contain_glance_api_config('DEFAULT/rbd_store_user').with_value('user') }
it { should contain_glance_api_config('DEFAULT/rbd_store_pool').with_value('images') }
it { should contain_glance_api_config('DEFAULT/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
it { should contain_glance_api_config('DEFAULT/rbd_store_chunk_size').with_value('8') }
it { should contain_package('python-ceph').with(
:name => 'python-ceph',
@ -23,4 +24,14 @@ describe 'glance::backend::rbd' do
)
}
describe 'when passing params' do
let :params do
{
:rbd_store_user => 'user',
:rbd_store_chunk_size => '2',
}
it { should contain_glance_api_config('DEFAULT/rbd_store_user').with_value('user') }
it { should contain_glance_api_config('DEFAULT/rbd_store_chunk_size').with_value('2') }
end
end
end