Add option to set Horizon memcache driver to correct template

Changeset Ice172b07fa765daff1a2e0feea7a5bee2f826b88 introduced changes
to local_settings.py template not used during deployment. This commit
reverts those and ports them to the template used in actual deployment.

Additionally some of ERB tags were not substituted or iterated correctly,
resulting in broken Horizon config.

Change-Id: I2092cf2a8c7407b814abcef28e843cf2da84444e
Closes-Bug: 1367767
This commit is contained in:
Bartłomiej Piotrowski 2015-05-19 13:24:34 +02:00
parent 2814c51668
commit cf58ee929d
2 changed files with 10 additions and 8 deletions

View File

@ -115,13 +115,9 @@ SECRET_KEY = '<%= @secret_key %>'
CACHES = {
'default': {
<% if @cache_server_ip %>
<% if @cache_options and @cache_options.kind_of?(Array) %>
OPTIONS : {
<% @cache_options.join(',') %>
}
<% end %>
#'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': <% @cache_backend %>
<% if @cache_server_ip.kind_of?(Array) %>
<% split = ":" + @cache_server_port + "','" %>
'LOCATION': [ <% @cache_server_ip.each do |ip| -%>'<%= ip -%>:<%= @cache_server_port -%>',<% end -%> ],

View File

@ -115,8 +115,14 @@ SECRET_KEY = '<%= @secret_key %>'
CACHES = {
'default': {
<% if @cache_server_ip %>
# 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': '<%= @cache_backend %>',
<% if @cache_options and @cache_options.kind_of?(Array) %>
'OPTIONS': {
<% @cache_options.each do |option| -%><%= option -%>,
<% end %>
},
<% end -%>
<% if @cache_server_ip.kind_of?(Array) %>
<% split = ":" + @cache_server_port + "','" %>
'LOCATION': [ <% @cache_server_ip.each do |ip| -%>'<%= ip -%>:<%= @cache_server_port -%>',<% end -%> ],