Merge "Accept array for cache_server_url"
This commit is contained in:
commit
aac496aa1b
|
@ -254,7 +254,7 @@ describe 'horizon' do
|
|||
it { is_expected.to contain_exec('refresh_horizon_django_compress') }
|
||||
end
|
||||
|
||||
context 'with overridden parameters and cache_server_url' do
|
||||
context 'with overridden parameters and cache_server_url (string)' do
|
||||
before do
|
||||
params.merge!({
|
||||
:cache_server_url => 'redis://:password@10.0.0.1:6379/1',
|
||||
|
@ -271,6 +271,23 @@ describe 'horizon' do
|
|||
it { is_expected.to contain_exec('refresh_horizon_django_compress') }
|
||||
end
|
||||
|
||||
context 'with overridden parameters and cache_server_url (array)' do
|
||||
before do
|
||||
params.merge!({
|
||||
:cache_server_url => ['192.0.2.1:11211', '192.0.2.2:11211'],
|
||||
})
|
||||
end
|
||||
|
||||
it 'generates local_settings.py' do
|
||||
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
||||
" 'LOCATION': ['192.0.2.1:11211','192.0.2.2:11211'],",
|
||||
])
|
||||
end
|
||||
|
||||
it { is_expected.to contain_exec('refresh_horizon_django_cache') }
|
||||
it { is_expected.to contain_exec('refresh_horizon_django_compress') }
|
||||
end
|
||||
|
||||
context 'installs python memcache library when cache_backend is set to memcache' do
|
||||
before do
|
||||
params.merge!({
|
||||
|
|
|
@ -243,8 +243,12 @@ CACHES = {
|
|||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- if @cache_server_url -%>
|
||||
<%- if @cache_server_url.kind_of?(Array) -%>
|
||||
'LOCATION': ['<%= @cache_server_url.join("','") %>'],
|
||||
<%- else -%>
|
||||
'LOCATION': '<%= @cache_server_url %>',
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue