Properly set POLICY_FILES_PATH on RHEL

RHEL puts the POLICY_FILES_PATH in a different location than Debian so we need
to ensure we set it. For Ubuntu/Debian, we'll explictly set the path they
currently use. Without this set properly, horizon fails to load up on RHEL.

Change-Id: If4f75ef8a3094154b2aecf435746f7a2050d5699
Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
Lance Albertson 2016-06-15 14:16:36 -07:00
parent e515bf84e1
commit 8717d2f073
4 changed files with 13 additions and 1 deletions

View File

@ -113,6 +113,7 @@ when 'rhel'
default['openstack']['dashboard']['ssl']['key_dir'] = '/etc/pki/tls/private/'
default['openstack']['dashboard']['local_settings_path'] = '/etc/openstack-dashboard/local_settings'
default['openstack']['dashboard']['django_path'] = '/usr/share/openstack-dashboard'
default['openstack']['dashboard']['policy_files_path'] = '/etc/openstack-dashboard'
default['openstack']['dashboard']['login_url'] = "#{node['openstack']['dashboard']['webroot']}auth/login/"
default['openstack']['dashboard']['logout_url'] = "#{node['openstack']['dashboard']['webroot']}auth/logout/"
default['openstack']['dashboard']['login_redirect_url'] = node['openstack']['dashboard']['webroot']
@ -131,6 +132,7 @@ when 'debian'
default['openstack']['dashboard']['ssl']['key_dir'] = '/etc/ssl/private/'
default['openstack']['dashboard']['local_settings_path'] = '/etc/openstack-dashboard/local_settings.py'
default['openstack']['dashboard']['django_path'] = '/usr/share/openstack-dashboard'
default['openstack']['dashboard']['policy_files_path'] = '/usr/share/openstack-dashboard/openstack_dashboard/conf'
default['openstack']['dashboard']['login_url'] = nil
default['openstack']['dashboard']['logout_url'] = nil
default['openstack']['dashboard']['login_redirect_url'] = nil

View File

@ -37,6 +37,11 @@ describe 'openstack-dashboard::horizon' do
expect(chef_run).to render_file(file.name).with_content(line)
end
end
it 'has policy file path set' do
expect(chef_run).to render_file(file.name)
.with_content(%r{^POLICY_FILES_PATH = '/etc/openstack-dashboard'$})
end
end
it 'does not remove openstack-dashboard-ubuntu-theme package' do

View File

@ -243,6 +243,11 @@ describe 'openstack-dashboard::horizon' do
end
end
it 'has policy file path set' do
expect(chef_run).to render_file(file.name)
.with_content(%r{^POLICY_FILES_PATH = '/usr/share/openstack-dashboard/openstack_dashboard/conf'$})
end
context 'identity and volume api version setting' do
it 'is configurable directly' do
node.set['openstack']['dashboard']['identity_api_version'] = 'identity_api_version_value'

View File

@ -298,7 +298,7 @@ TIME_ZONE = "UTC"
# target installation.
# Path to directory containing policy.json files
#POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
POLICY_FILES_PATH = '<%= node['openstack']['dashboard']['policy_files_path'] %>'
# Map of local copy of service policy files
#POLICY_FILES = {
# 'identity': 'keystone_policy.json',