Add support for [cache] backend_expiration_time
Depends-on: https://review.opendev.org/932301 Change-Id: Iaf4082ce3bff32712d2c26cbaca4a70d19066472
This commit is contained in:
parent
6b04e13ad4
commit
c866d86a06
@ -50,6 +50,11 @@
|
|||||||
# (integer value)
|
# (integer value)
|
||||||
# Defaults to $facts['os_service_default']
|
# Defaults to $facts['os_service_default']
|
||||||
#
|
#
|
||||||
|
# [*backend_expiration_time*]
|
||||||
|
# (Optional) Expiration time in cache backend to purge expired records
|
||||||
|
# automatically.
|
||||||
|
# Defaults to $facts['os_service_default']
|
||||||
|
#
|
||||||
# [*backend*]
|
# [*backend*]
|
||||||
# (Optional) Dogpile.cache backend module. It is recommended that
|
# (Optional) Dogpile.cache backend module. It is recommended that
|
||||||
# Memcache with pooling (oslo_cache.memcache_pool) or Redis
|
# Memcache with pooling (oslo_cache.memcache_pool) or Redis
|
||||||
@ -251,6 +256,7 @@
|
|||||||
define oslo::cache(
|
define oslo::cache(
|
||||||
$config_prefix = $facts['os_service_default'],
|
$config_prefix = $facts['os_service_default'],
|
||||||
$expiration_time = $facts['os_service_default'],
|
$expiration_time = $facts['os_service_default'],
|
||||||
|
$backend_expiration_time = $facts['os_service_default'],
|
||||||
$backend = $facts['os_service_default'],
|
$backend = $facts['os_service_default'],
|
||||||
$backend_argument = $facts['os_service_default'],
|
$backend_argument = $facts['os_service_default'],
|
||||||
$proxies = $facts['os_service_default'],
|
$proxies = $facts['os_service_default'],
|
||||||
@ -360,6 +366,7 @@ define oslo::cache(
|
|||||||
$cache_options = {
|
$cache_options = {
|
||||||
'cache/config_prefix' => { value => $config_prefix },
|
'cache/config_prefix' => { value => $config_prefix },
|
||||||
'cache/expiration_time' => { value => $expiration_time },
|
'cache/expiration_time' => { value => $expiration_time },
|
||||||
|
'cache/backend_expiration_time' => { value => $backend_expiration_time },
|
||||||
'cache/backend' => { value => $backend },
|
'cache/backend' => { value => $backend },
|
||||||
'cache/backend_argument' => { value => $backend_argument },
|
'cache/backend_argument' => { value => $backend_argument },
|
||||||
'cache/proxies' => { value => join(any2array($proxies), ',') },
|
'cache/proxies' => { value => join(any2array($proxies), ',') },
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``oslo::cache::backend_expiration_time`` parameter has been added.
|
@ -10,6 +10,7 @@ describe 'oslo::cache' do
|
|||||||
it 'configure oslo_cache default params' do
|
it 'configure oslo_cache default params' do
|
||||||
is_expected.to contain_keystone_config('cache/config_prefix').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_keystone_config('cache/config_prefix').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_keystone_config('cache/expiration_time').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_keystone_config('cache/expiration_time').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_keystone_config('cache/backend_expiration_time').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_keystone_config('cache/backend').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_keystone_config('cache/backend').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_keystone_config('cache/backend_argument').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_keystone_config('cache/backend_argument').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_keystone_config('cache/proxies').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_keystone_config('cache/proxies').with_value('<SERVICE DEFAULT>')
|
||||||
@ -53,7 +54,8 @@ describe 'oslo::cache' do
|
|||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:config_prefix => 'cache.oslo',
|
:config_prefix => 'cache.oslo',
|
||||||
:expiration_time => '600',
|
:expiration_time => 600,
|
||||||
|
:backend_expiration_time => 700,
|
||||||
:backend => 'dogpile.cache.null',
|
:backend => 'dogpile.cache.null',
|
||||||
:backend_argument => ['arg1:val1', 'arg2:val2'],
|
:backend_argument => ['arg1:val1', 'arg2:val2'],
|
||||||
:proxies => ['proxy1', 'proxy2'],
|
:proxies => ['proxy1', 'proxy2'],
|
||||||
@ -95,7 +97,8 @@ describe 'oslo::cache' do
|
|||||||
|
|
||||||
it 'configures cache section' do
|
it 'configures cache section' do
|
||||||
is_expected.to contain_keystone_config('cache/config_prefix').with_value('cache.oslo')
|
is_expected.to contain_keystone_config('cache/config_prefix').with_value('cache.oslo')
|
||||||
is_expected.to contain_keystone_config('cache/expiration_time').with_value('600')
|
is_expected.to contain_keystone_config('cache/expiration_time').with_value(600)
|
||||||
|
is_expected.to contain_keystone_config('cache/backend_expiration_time').with_value(700)
|
||||||
is_expected.to contain_keystone_config('cache/backend').with_value('dogpile.cache.null')
|
is_expected.to contain_keystone_config('cache/backend').with_value('dogpile.cache.null')
|
||||||
is_expected.to contain_keystone_config('cache/backend_argument').with_value(['arg1:val1', 'arg2:val2'])
|
is_expected.to contain_keystone_config('cache/backend_argument').with_value(['arg1:val1', 'arg2:val2'])
|
||||||
is_expected.to contain_keystone_config('cache/proxies').with_value('proxy1,proxy2')
|
is_expected.to contain_keystone_config('cache/proxies').with_value('proxy1,proxy2')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user