Initial Liberty Changes

Metadata changes
- Updated maintainer email
- Updated the version

rubocop updates
remove db2 refs

Change-Id: I5ff8ca0939f13e583f8d4ff75ff91a4805e78381
This commit is contained in:
JJ Asghar 2015-08-27 15:37:36 -05:00 committed by Mark Vanderwiel
parent b3d97d1ee3
commit 0c8ae1d0b9
7 changed files with 24 additions and 35 deletions

View File

@ -84,7 +84,6 @@ default['openstack']['dashboard']['webroot'] = '/'
# Dashboard specific database packages
# Put common ones here and platform specific ones below.
default['openstack']['dashboard']['db_python_packages'] = {
db2: [],
mysql: [],
postgresql: [],
sqlite: []
@ -107,7 +106,6 @@ when 'rhel'
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']
default['openstack']['dashboard']['db_python_packages']['db2'] = ['python-ibm-db-django']
default['openstack']['dashboard']['platform'] = {
'horizon_packages' => ['openstack-dashboard'],
'memcache_python_packages' => ['python-memcached'],

View File

@ -1,10 +1,10 @@
name 'openstack-dashboard'
maintainer 'openstack-chef'
maintainer_email 'opscode-chef-openstack@googlegroups.com'
maintainer_email 'openstack-dev@lists.openstack.org'
license 'Apache 2.0'
description 'Installs/Configures the OpenStack Dashboard (Horizon)'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '11.0.0'
version '12.0.0'
recipe 'openstack-dashboard::horizon', 'Sets up the Horizon dashboard.'
recipe 'openstack-dashboard::apache2-server', 'Sets up an Apache `mod_wsgi` container to run the dashboard.'
@ -15,4 +15,4 @@ recipe 'openstack-dashboard::server', 'Sets up the Horizon dashboard and webserv
end
depends 'apache2', '~> 3.1'
depends 'openstack-common', '>= 11.1.0'
depends 'openstack-common', '>= 12.0.0'

View File

@ -33,7 +33,7 @@ describe 'openstack-dashboard::apache2-server' do
user: 'root',
group: 'root',
mode: 0644
)
)
end
it 'creates horizon.key' do
@ -41,7 +41,7 @@ describe 'openstack-dashboard::apache2-server' do
user: 'root',
group: 'root',
mode: 0640
)
)
end
it 'notifies restore-selinux-context' do

View File

@ -150,7 +150,7 @@ describe 'openstack-dashboard::apache2-server' do
user: 'root',
group: 'root',
mode: 0644
)
)
end
context 'template content' do
@ -305,7 +305,7 @@ describe 'openstack-dashboard::apache2-server' do
it 'sets the right Alias path for /static' do
node.set['openstack']['dashboard']['static_path'] = 'static_path_value'
expect(chef_run).to render_file(file.name).with_content(/^\s+Alias \/static static_path_value$/)
expect(chef_run).to render_file(file.name).with_content(%r{^\s+Alias /static static_path_value$})
end
%w(dash_path static_path).each do |dir_attribute|
@ -333,12 +333,12 @@ describe 'openstack-dashboard::apache2-server' do
it 'sets de ErrorLog directive' do
node.set['openstack']['dashboard']['error_log'] = 'error_log_value'
expect(chef_run).to render_file(file.name).with_content(/^\s*ErrorLog log_dir_value\/error_log_value$/)
expect(chef_run).to render_file(file.name).with_content(%r{^\s*ErrorLog log_dir_value/error_log_value$})
end
it 'sets de CustomLog directive' do
node.set['openstack']['dashboard']['access_log'] = 'access_log_value'
expect(chef_run).to render_file(file.name).with_content(/^\s*CustomLog log_dir_value\/access_log_value combined$/)
expect(chef_run).to render_file(file.name).with_content(%r{^\s*CustomLog log_dir_value/access_log_value combined$})
end
end
@ -409,7 +409,7 @@ describe 'openstack-dashboard::apache2-server' do
resource = chef_run.find_resource('execute',
'a2dissite 000-default.conf').to_hash
expect(resource).to include(
action: 'run',
action: [:run],
params: {
enable: false,
name: '000-default'
@ -421,7 +421,7 @@ describe 'openstack-dashboard::apache2-server' do
resource = chef_run.find_resource('execute',
'a2ensite openstack-dashboard.conf').to_hash
expect(resource).to include(
action: 'run',
action: [:run],
params: {
enable: true,
notifies: [:reload, 'service[apache2]', :immediately],

View File

@ -17,13 +17,6 @@ describe 'openstack-dashboard::horizon' do
expect(chef_run).to upgrade_package('MySQL-python')
end
it 'installs db2 python packages if explicitly told' do
node.set['openstack']['db']['dashboard']['service_type'] = 'db2'
%w(python-ibm-db python-ibm-db-django python-ibm-db-sa).each do |pkg|
expect(chef_run).to upgrade_package(pkg)
end
end
describe 'local_settings' do
let(:file) { chef_run.template('/etc/openstack-dashboard/local_settings') }
@ -32,14 +25,14 @@ describe 'openstack-dashboard::horizon' do
user: 'root',
group: 'apache',
mode: 0640
)
)
end
it 'has urls set' do
[
%r{^LOGIN_URL = '/auth/login/'$},
%r{^LOGOUT_URL = '/auth/logout/'$},
/^LOGIN_REDIRECT_URL = '\/'$/
%r{^LOGIN_REDIRECT_URL = '/'$}
].each do |line|
expect(chef_run).to render_file(file.name).with_content(line)
end

View File

@ -32,7 +32,7 @@ describe 'openstack-dashboard::horizon' do
user: 'root',
group: 'horizon',
mode: 0640
)
)
end
it 'notifies web service to restart delayed' do
@ -132,13 +132,13 @@ describe 'openstack-dashboard::horizon' do
it 'config ssl_cacert' do
node.set['openstack']['dashboard']['ssl_cacert'] = '/path_to_cacert.pem'
expect(chef_run).to render_file(file.name).with_content(/^OPENSTACK_SSL_CACERT = '\/path_to_cacert.pem'$/)
expect(chef_run).to render_file(file.name).with_content(%r{^OPENSTACK_SSL_CACERT = '/path_to_cacert.pem'$})
end
it 'does not config ssl_cacert when ssl disabled' do
node.set['openstack']['dashboard']['use_ssl'] = false
node.set['openstack']['dashboard']['ssl_cacert'] = '/path_to_cacert.pem'
expect(chef_run).not_to render_file(file.name).with_content(/^OPENSTACK_SSL_CACERT = '\/path_to_cacert.pem'$/)
expect(chef_run).not_to render_file(file.name).with_content(%r{^OPENSTACK_SSL_CACERT = '/path_to_cacert.pem'$})
end
it 'has some allowed hosts set' do
@ -185,7 +185,7 @@ describe 'openstack-dashboard::horizon' do
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"$/)
expect(chef_run).to render_file(file.name).with_content(%r{^FILE_UPLOAD_TEMP_DIR = "/foobar"$})
end
end
end
@ -230,7 +230,7 @@ describe 'openstack-dashboard::horizon' do
end
it 'does have webroot set' do
expect(chef_run).to render_file(file.name).with_content(/^WEBROOT = \'\/\'$/)
expect(chef_run).to render_file(file.name).with_content(%r{^WEBROOT = '/'$})
end
it 'does not have urls set' do
@ -426,8 +426,7 @@ describe 'openstack-dashboard::horizon' do
{ 'mysql' => 'django.db.backends.mysql',
'sqlite' => 'django.db.backends.sqlite3',
'postgresql' => 'django.db.backends.postgresql_psycopg2',
'db2' => 'ibm_db_django' }.each do |service_type, backend|
'postgresql' => 'django.db.backends.postgresql_psycopg2' }.each do |service_type, backend|
context "#{service_type} database settings" do
before do
allow_any_instance_of(Chef::Recipe).to receive(:db)
@ -499,14 +498,14 @@ describe 'openstack-dashboard::horizon' do
expect(chef_run).not_to run_execute(sync_db_cmd).with(
cwd: node['openstack']['dashboard']['django_path'],
environment: sync_db_environment
)
)
end
it 'executes when session_backend is sql' do
expect(chef_run_session_sql).to run_execute(sync_db_cmd).with(
cwd: node['openstack']['dashboard']['django_path'],
environment: sync_db_environment
)
)
end
it 'does not execute when the migrate attribute is set to false' do
@ -514,7 +513,7 @@ describe 'openstack-dashboard::horizon' do
expect(chef_run_session_sql).not_to run_execute(sync_db_cmd).with(
cwd: node['openstack']['dashboard']['django_path'],
environment: sync_db_environment
)
)
end
it 'executes when database backend is sqlite' do
@ -522,7 +521,7 @@ describe 'openstack-dashboard::horizon' do
expect(chef_run_session_sql).to run_execute(sync_db_cmd).with(
cwd: node['openstack']['dashboard']['django_path'],
environment: sync_db_environment
)
)
end
end

View File

@ -559,8 +559,7 @@ FLAVOR_EXTRA_KEYS = {
<% django_backends = {'mysql' => 'django.db.backends.mysql',
'sqlite' => 'django.db.backends.sqlite3',
'postgresql' => 'django.db.backends.postgresql_psycopg2',
'db2' => 'ibm_db_django'}
'postgresql' => 'django.db.backends.postgresql_psycopg2'}
engine = django_backends[@db_info['service_type']] %>
# A dictionary containing the settings for all databases to be used with