diff --git a/attributes/default.rb b/attributes/default.rb index 6aa7239..4554de4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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 diff --git a/spec/horizon-redhat_spec.rb b/spec/horizon-redhat_spec.rb index 5620fd0..2b20836 100644 --- a/spec/horizon-redhat_spec.rb +++ b/spec/horizon-redhat_spec.rb @@ -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 diff --git a/spec/horizon_spec.rb b/spec/horizon_spec.rb index 5608779..c5e0bd4 100644 --- a/spec/horizon_spec.rb +++ b/spec/horizon_spec.rb @@ -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' diff --git a/templates/default/local_settings.py.erb b/templates/default/local_settings.py.erb index 96e3996..520a353 100644 --- a/templates/default/local_settings.py.erb +++ b/templates/default/local_settings.py.erb @@ -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',