Merge "Allow file_upload_temp_dir override"

This commit is contained in:
Jenkins 2014-10-22 14:37:33 +00:00 committed by Gerrit Code Review
commit 81125daae5
4 changed files with 20 additions and 2 deletions

View File

@ -14,10 +14,9 @@ This file is used to list changes made in each version of the openstack-dashboar
* Add sensitive flag to private key and certificate file resources
* Add hash algorithm option to local_settings
* Update user group for local_settings from root to horizon user group
* Bump Chef gem to 11.16
* Add sensitive flag to local_settings file resource
* allow override of the temporary directory used for file uploads
## 9.1
* python_packages database client attributes have been moved to the -common cookbook

View File

@ -147,6 +147,8 @@ default['openstack']['dashboard']['session_backend'] = 'memcached'
default['openstack']['dashboard']['ssl_offload'] = false
default['openstack']['dashboard']['plugins'] = nil
default['openstack']['dashboard']['file_upload_temp_dir'] = nil
default['openstack']['dashboard']['error_log'] = 'openstack-dashboard-error.log'
default['openstack']['dashboard']['access_log'] = 'openstack-dashboard-access.log'

View File

@ -221,6 +221,19 @@ describe 'openstack-dashboard::server' do
end
end
context 'temp dir override' do
context 'temp dir is nil' do
it 'does not override temp dir when it is nil' do
node.set['openstack']['dashboard']['file_upload_temp_dir'] = nil
expect(chef_run).not_to render_file(file.name).with_content(/^FILE_UPLOAD_TEMP_DIR =/)
end
it 'does override temp dir when it is not nil' do
node.set['openstack']['dashboard']['file_upload_temp_dir'] = '/foobar'
expect(chef_run).to render_file(file.name).with_content(/^FILE_UPLOAD_TEMP_DIR = "\/foobar"$/)
end
end
end
context 'ssl settings' do
context 'use_ssl enabled' do
before do

View File

@ -611,3 +611,7 @@ mod.INSTALLED_APPS += ('<%= p %>', )
<% end %>
<% end %>
# define a custom tmp upload directory (override /tmp)
<% if node["openstack"]["dashboard"]["file_upload_temp_dir"] %>
FILE_UPLOAD_TEMP_DIR = "<%= node["openstack"]["dashboard"]["file_upload_temp_dir"] %>"
<% end %>