Ensure inet6: formatting for a comma-separated list string
Currently the inet6_prefix function recognizes a comma-separated list as a single string, thus the format is not applied. This change ensures the value is converted to an array and the format conversion is properly enforced. Change-Id: I9a1f452c3797ccbda25865ca78f1e3a24103d070
This commit is contained in:
parent
b8bc0eba5f
commit
c2525c6e63
@ -294,7 +294,12 @@ define keystone::resource::authtoken(
|
||||
}
|
||||
|
||||
if !is_service_default($memcached_servers) and !empty($memcached_servers){
|
||||
$memcached_servers_real = join(any2array(inet6_prefix($memcached_servers)), ',')
|
||||
$memcached_servers_array = $memcached_servers ? {
|
||||
String => split($memcached_servers, ','),
|
||||
default => $memcached_servers
|
||||
}
|
||||
$memcached_servers_real = join(any2array(inet6_prefix($memcached_servers_array)), ',')
|
||||
|
||||
if $manage_memcache_package {
|
||||
ensure_packages('python-memcache', {
|
||||
ensure => present,
|
||||
|
@ -180,13 +180,40 @@ describe 'keystone::resource::authtoken' do
|
||||
end
|
||||
|
||||
context 'when specifying IPv6 memcached_servers params' do
|
||||
before do
|
||||
params.merge! ({
|
||||
:memcached_servers => '[fd12:3456:789a:1::1]:11211',
|
||||
})
|
||||
context 'by a string' do
|
||||
before do
|
||||
params.merge! ({
|
||||
:memcached_servers => '[fd12:3456:789a:1::1]:11211',
|
||||
})
|
||||
end
|
||||
it 'configures memcache severs with inet6: prefix in keystone authtoken' do
|
||||
is_expected.to contain_keystone_config('keystone_authtoken/memcached_servers')\
|
||||
.with_value('inet6:[fd12:3456:789a:1::1]:11211')
|
||||
end
|
||||
end
|
||||
it 'configures memcache severs with inet6: prefix in keystone authtoken' do
|
||||
is_expected.to contain_keystone_config('keystone_authtoken/memcached_servers').with_value('inet6:[fd12:3456:789a:1::1]:11211')
|
||||
|
||||
context 'by a commma-separated string' do
|
||||
before do
|
||||
params.merge! ({
|
||||
:memcached_servers => '[fd12:3456:789a:1::1]:11211,[fd12:3456:789a:1::2]:11211',
|
||||
})
|
||||
end
|
||||
it 'configures memcache severs with inet6: prefix in keystone authtoken' do
|
||||
is_expected.to contain_keystone_config('keystone_authtoken/memcached_servers')\
|
||||
.with_value('inet6:[fd12:3456:789a:1::1]:11211,inet6:[fd12:3456:789a:1::2]:11211')
|
||||
end
|
||||
end
|
||||
|
||||
context 'by an array' do
|
||||
before do
|
||||
params.merge! ({
|
||||
:memcached_servers => ['[fd12:3456:789a:1::1]:11211', '[fd12:3456:789a:1::2]:11211']
|
||||
})
|
||||
end
|
||||
it 'configures memcache severs with inet6: prefix in keystone authtoken' do
|
||||
is_expected.to contain_keystone_config('keystone_authtoken/memcached_servers')\
|
||||
.with_value('inet6:[fd12:3456:789a:1::1]:11211,inet6:[fd12:3456:789a:1::2]:11211')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user