Add rados_connect_timeout parameter in glance config

It adds rados_connect_timeout parameter with default value
to glance config, which tells how much time glance-api has
to wait before close the connection.

Setting 'rados_connect_timeout' <= 0  means no timeout.

A CR that adds "rados_connect_timeout": #200554
change-id: Ib44f74063d5a8332c6b5f3e15bcfa044c86bef9b

Change-Id: I2352bdec2a3339785eb38249afe385c5e496457c
This commit is contained in:
Maksym Yatsenko 2015-08-31 14:00:54 +03:00
parent 4e8e53bff3
commit 323162d6c9
2 changed files with 15 additions and 5 deletions

View File

@ -26,6 +26,11 @@
# accepts latest or specific versions.
# Defaults to present.
#
# [*rados_connect_timeout*]
# Optinal. Timeout value (in seconds) used when connecting
# to ceph cluster. If value <= 0, no timeout is set and
# default librados value is used.
#
class glance::backend::rbd(
$rbd_store_user = undef,
@ -34,6 +39,7 @@ class glance::backend::rbd(
$rbd_store_chunk_size = '8',
$show_image_direct_url = undef,
$package_ensure = 'present',
$rados_connect_timeout = '0',
) {
include ::glance::params
@ -42,11 +48,12 @@ class glance::backend::rbd(
}
glance_api_config {
'glance_store/default_store': value => 'rbd';
'glance_store/rbd_store_ceph_conf': value => $rbd_store_ceph_conf;
'glance_store/rbd_store_user': value => $rbd_store_user;
'glance_store/rbd_store_pool': value => $rbd_store_pool;
'glance_store/rbd_store_chunk_size': value => $rbd_store_chunk_size;
'glance_store/default_store': value => 'rbd';
'glance_store/rbd_store_ceph_conf': value => $rbd_store_ceph_conf;
'glance_store/rbd_store_user': value => $rbd_store_user;
'glance_store/rbd_store_pool': value => $rbd_store_pool;
'glance_store/rbd_store_chunk_size': value => $rbd_store_chunk_size;
'glance_store/rados_connect_timeout': value => $rados_connect_timeout;
}
package { 'python-ceph':

View File

@ -18,6 +18,7 @@ describe 'glance::backend::rbd' do
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_pool').with_value('images') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('8') }
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('0')}
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph',
@ -32,10 +33,12 @@ describe 'glance::backend::rbd' do
:rbd_store_user => 'user',
:rbd_store_chunk_size => '2',
:package_ensure => 'latest',
:rados_connect_timeout => '30',
}
end
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_user').with_value('user') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('2') }
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('30')}
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph',
:ensure => 'latest'