From 964aef7a16e9e1cfa372f8918361a77525bc92f1 Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Tue, 31 Mar 2015 16:42:34 -0500 Subject: [PATCH] Need WEBROOT in local_settings.py file Horizon relies on the WEBROOT setting in order to handle static resources. Change-Id: Ia6b8d3453fec70d5865d52843e2ae3c48c2a0865 Closes-Bug: #1438922 --- spec/horizon_spec.rb | 4 ++++ templates/default/local_settings.py.erb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/spec/horizon_spec.rb b/spec/horizon_spec.rb index a8d5f94..c927027 100644 --- a/spec/horizon_spec.rb +++ b/spec/horizon_spec.rb @@ -222,6 +222,10 @@ describe 'openstack-dashboard::horizon' do end end + it 'does have webroot set' do + expect(chef_run).to render_file(file.name).with_content(/^WEBROOT = \'\/\'$/) + end + it 'does not have urls set' do [ /^LOGIN_URL =$/, diff --git a/templates/default/local_settings.py.erb b/templates/default/local_settings.py.erb index 57240b6..0b943c6 100644 --- a/templates/default/local_settings.py.erb +++ b/templates/default/local_settings.py.erb @@ -9,6 +9,8 @@ from openstack_dashboard import exceptions DEBUG = <%= node["openstack"]["dashboard"]["debug"] ? "True" : "False" %> TEMPLATE_DEBUG = DEBUG +WEBROOT = '<%= node['openstack']['dashboard']['webroot'] %>' + <% if node["openstack"]["dashboard"]["login_url"] %> LOGIN_URL = '<%= node['openstack']['dashboard']['login_url'] %>' <% end %>