cache: Add inet6 prefix for only memcached backends
The inet6 prefix is required only by backends dependent on python-memcached and SHOULD NOT be added when the other backends like pymemcache backend are used. Closes-Bug: #1965318 Change-Id: I351bd1f291b9e948cb73592a5a742d051a048d00
This commit is contained in:
parent
37185e7c56
commit
95544711d4
@ -245,11 +245,15 @@ define oslo::cache(
|
||||
if is_service_default($memcache_servers) {
|
||||
$memcache_servers_real = $memcache_servers
|
||||
} else {
|
||||
$memcache_servers_array = $memcache_servers ? {
|
||||
String => split($memcache_servers, ','),
|
||||
default => $memcache_servers
|
||||
if $backend =~ /\.memcache/ {
|
||||
$memcache_servers_array = $memcache_servers ? {
|
||||
String => split($memcache_servers, ','),
|
||||
default => $memcache_servers
|
||||
}
|
||||
$memcache_servers_real = join(any2array(inet6_prefix($memcache_servers_array)), ',')
|
||||
} else {
|
||||
$memcache_servers_real = join(any2array($memcache_servers), ',')
|
||||
}
|
||||
$memcache_servers_real = join(any2array(inet6_prefix($memcache_servers_array)), ',')
|
||||
}
|
||||
|
||||
if $manage_backend_package {
|
||||
|
@ -81,7 +81,7 @@ describe 'oslo::cache' do
|
||||
is_expected.to contain_keystone_config('cache/proxies').with_value('proxy1,proxy2')
|
||||
is_expected.to contain_keystone_config('cache/enabled').with_value('true')
|
||||
is_expected.to contain_keystone_config('cache/debug_cache_backend').with_value('true')
|
||||
is_expected.to contain_keystone_config('cache/memcache_servers').with_value('host1:11211,host2:11211,inet6:[fd12:3456:789a:1::1]:11211')
|
||||
is_expected.to contain_keystone_config('cache/memcache_servers').with_value('host1:11211,host2:11211,[fd12:3456:789a:1::1]:11211')
|
||||
is_expected.to contain_keystone_config('cache/memcache_dead_retry').with_value('300')
|
||||
is_expected.to contain_keystone_config('cache/memcache_socket_timeout').with_value('3.0')
|
||||
is_expected.to contain_keystone_config('cache/enable_socket_keepalive').with_value('false')
|
||||
@ -153,12 +153,14 @@ describe 'oslo::cache' do
|
||||
context 'with memcache backend' do
|
||||
let :params do
|
||||
{
|
||||
:backend => 'dogpile.cache.memcache',
|
||||
:backend => 'dogpile.cache.memcache',
|
||||
:memcache_servers => ['host1:11211', 'host2:11211','[fd12:3456:789a:1::1]:11211'],
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures cache backend' do
|
||||
is_expected.to contain_keystone_config('cache/backend').with_value('dogpile.cache.memcache')
|
||||
is_expected.to contain_keystone_config('cache/memcache_servers').with_value('host1:11211,host2:11211,inet6:[fd12:3456:789a:1::1]:11211')
|
||||
is_expected.to contain_package('python-memcache').with(
|
||||
:ensure => 'installed',
|
||||
:name => platform_params[:python_memcache_package_name],
|
||||
|
Loading…
x
Reference in New Issue
Block a user