Skip to content
This repository was archived by the owner on Dec 4, 2018. It is now read-only.

[post-tex] Drop PFS support #214

Merged
merged 1 commit into from
May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion chef/cookbooks/nova_dashboard/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
depends "apache2"
depends "database"
depends "nagios"
depends "git"
depends "memcached"
depends "keystone"
depends "crowbar-openstack"
Expand Down
78 changes: 26 additions & 52 deletions chef/cookbooks/nova_dashboard/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,35 @@
include_recipe "apache2::mod_ssl"
end

unless node[:nova_dashboard][:use_gitrepo]
if %w(debian ubuntu).include?(node.platform)
# Explicitly added client dependencies for now.
packages = [ "python-lesscpy", "python-ply", "openstack-dashboard", "python-novaclient", "python-glance", "python-swift", "python-keystone", "openstackx", "python-django", "python-django-horizon", "python-django-nose" ]
packages.each do |pkg|
package pkg do
action :install
end
if %w(debian ubuntu).include?(node.platform)
# Explicitly added client dependencies for now.
packages = [ "python-lesscpy", "python-ply", "openstack-dashboard", "python-novaclient", "python-glance", "python-swift", "python-keystone", "openstackx", "python-django", "python-django-horizon", "python-django-nose" ]
packages.each do |pkg|
package pkg do
action :install
end
end

rm_pkgs = [ "openstack-dashboard-ubuntu-theme" ]
rm_pkgs.each do |pkg|
package pkg do
action :purge
end
end
elsif %w(redhat centos).include?(node.platform)
package "openstack-dashboard"
package "python-lesscpy"
package "python-memcached"
else
# On SUSE, the package has the correct list of dependencies
package "openstack-dashboard"

# Install the configured branding
unless node[:nova_dashboard][:site_theme].empty?
package "openstack-dashboard-theme-#{node[:nova_dashboard][:site_theme]}" do
action :install
notifies :reload, resources(:service => "apache2")
end
rm_pkgs = [ "openstack-dashboard-ubuntu-theme" ]
rm_pkgs.each do |pkg|
package pkg do
action :purge
end
end
elsif %w(redhat centos).include?(node.platform)
package "openstack-dashboard"
package "python-lesscpy"
package "python-memcached"
else
venv_path = node[:nova_dashboard][:use_virtualenv] ? "#{dashboard_path}/.venv" : nil
venv_prefix = node[:nova_dashboard][:use_virtualenv] ? ". #{venv_path}/bin/activate &&" : nil

pfs_and_install_deps "nova_dashboard" do
path dashboard_path
virtualenv venv_path
end

execute "chown_#{node[:apache][:user]}" do
command "chown -R #{node[:apache][:user]}:#{node[:apache][:group]} #{dashboard_path}"
# On SUSE, the package has the correct list of dependencies
package "openstack-dashboard"

# Install the configured branding
unless node[:nova_dashboard][:site_theme].empty?
package "openstack-dashboard-theme-#{node[:nova_dashboard][:site_theme]}" do
action :install
notifies :reload, resources(:service => "apache2")
end
end
end

Expand Down Expand Up @@ -257,7 +243,7 @@
execute "python manage.py syncdb" do
cwd dashboard_path
environment ({'PYTHONPATH' => dashboard_path})
command "#{venv_prefix} python manage.py syncdb --noinput"
command "python manage.py syncdb --noinput"
user node[:apache][:user]
group node[:apache][:group]
action :nothing
Expand Down Expand Up @@ -341,25 +327,13 @@
:use_ssl => node[:nova_dashboard][:apache][:ssl],
:ssl_crt_file => node[:nova_dashboard][:apache][:ssl_crt_file],
:ssl_key_file => node[:nova_dashboard][:apache][:ssl_key_file],
:ssl_crt_chain_file => node[:nova_dashboard][:apache][:ssl_crt_chain_file],
:venv => node[:nova_dashboard][:use_virtualenv] && node[:nova_dashboard][:use_gitrepo],
:venv_path => venv_path
:ssl_crt_chain_file => node[:nova_dashboard][:apache][:ssl_crt_chain_file]
)
if ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/nova-dashboard.conf") or node.platform == "suse"
notifies :reload, resources(:service => "apache2")
end
end

if node[:nova_dashboard][:use_virtualenv] && node[:nova_dashboard][:use_gitrepo]
template "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django_venv.wsgi" do
source "django_venv.wsgi.erb"
mode 0644
variables(
:venv_path => venv_path
)
end
end

apache_site "nova-dashboard.conf" do
enable true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
# behind a load-balancer). Either you have to make sure that a session gets all
# requests routed to the same dashboard instance or you set the same SECRET_KEY
# for all of them.
<% if (node.platform == "suse") or (node.platform == "ubuntu" and node[:nova_dashboard][:use_gitrepo]) -%>
<% if (node.platform == "suse") -%>
from horizon.utils import secret_key
SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
<% end -%>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
# behind a load-balancer). Either you have to make sure that a session gets all
# requests routed to the same dashboard instance or you set the same SECRET_KEY
# for all of them.
<% if (node.platform == "suse") or (node.platform == "ubuntu" and node[:nova_dashboard][:use_gitrepo]) -%>
<% if (node.platform == "suse") -%>
from horizon.utils import secret_key
SECRET_KEY = secret_key.generate_or_read_from_file(
os.path.join(LOCAL_PATH, '.secret_key_store'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ RewriteRule / https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
<VirtualHost <%= @bind_host %>:<%= @bind_port %>>
<% end %>
WSGIDaemonProcess horizon user=<%= @user %> group=<%= @group %> processes=3 threads=10 home=<%= @horizon_dir %>
<% if @venv -%>
WSGIScriptAlias / <%= @horizon_dir %>/openstack_dashboard/wsgi/django_venv.wsgi
<% else -%>
WSGIScriptAlias / <%= @horizon_dir %>/openstack_dashboard/wsgi/django.wsgi
<% end -%>
SetEnv APACHE_RUN_USER <%= @user %>
SetEnv APACHE_RUN_GROUP <%= @group %>
WSGIProcessGroup horizon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
# behind a load-balancer). Either you have to make sure that a session gets all
# requests routed to the same dashboard instance or you set the same SECRET_KEY
# for all of them.
<% if (node.platform == "suse") or (node.platform == "ubuntu" and node[:nova_dashboard][:use_gitrepo]) -%>
<% if (node.platform == "suse") -%>
from horizon.utils import secret_key
SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
<% end -%>
Expand Down
21 changes: 2 additions & 19 deletions chef/data_bags/crowbar/bc-template-nova_dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,14 @@
"ssl_key_file": "/etc/apache2/ssl.key/openstack-dashboard-server.key",
"ssl_crt_chain_file": ""
},
"external_monitoring": {},
"gitrepo": "http://github.com/openstack/horizon.git",
"git_instance": "",
"git_refspec": "stable/icehouse",
"use_gitbarclamp": true,
"use_pip_cache": true,
"use_virtualenv": true,
"pfs_deps": [
"apache2",
"libapache2-mod-wsgi",
"pip://setuptools-git",
"pip://distribute>=0.6.28",
"pip://MySQL-python",
"pip://python-memcached",
"pip://ply",
"pip://lesscpy"
],
"use_gitrepo": false
"external_monitoring": {}
}
},
"deployment": {
"nova_dashboard": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 21,
"schema-revision": 30,
"element_states": {
"nova_dashboard-server": [ "readying", "ready", "applying" ]
},
Expand Down
10 changes: 1 addition & 9 deletions chef/data_bags/crowbar/bc-template-nova_dashboard.schema
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,7 @@
"mapping": {
=: { "type": "str", "required": false }
}
},
"gitrepo": { "type": "str", "required": true },
"git_instance": { "type": "str", "required": true },
"git_refspec": { "type": "str", "required": true },
"use_gitrepo": { "type": "bool", "required": true },
"use_gitbarclamp": { "type": "bool", "required": true },
"use_pip_cache": { "type": "bool", "required": true },
"use_virtualenv": { "type": "bool", "required": true },
"pfs_deps": { "type": "seq", "required": true, "sequence": [ { "type": "str" } ] }
}
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions chef/data_bags/crowbar/migrate/nova_dashboard/030_drop_pfs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def upgrade ta, td, a, d
%w(gitrepo git_instance git_refspec use_gitbarclamp use_pip_cache use_gitrepo use_virtualenv pfs_deps).each do |attr|
a.delete(attr)
end
return a, d
end

def downgrade ta, td, a, d
%w(gitrepo git_instance git_refspec use_gitbarclamp use_pip_cache use_gitrepo use_virtualenv pfs_deps).each do |attr|
a[attr] = ta[attr]
end
return a, d
end
3 changes: 0 additions & 3 deletions crowbar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ crowbar:
run_order: 96
chef_order: 96
proposal_schema_version: 3

git_repo:
- 'nova_dashboard https://github.com/openstack/horizon.git stable/juno'
8 changes: 0 additions & 8 deletions crowbar_framework/app/models/nova_dashboard_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ def role_constraints
def proposal_dependencies(role)
answer = []
answer << { "barclamp" => "database", "inst" => role.default_attributes["nova_dashboard"]["database_instance"] }
if role.default_attributes[@bc_name]["use_gitrepo"]
answer << { "barclamp" => "git", "inst" => role.default_attributes[@bc_name]["git_instance"] }
end
answer << { "barclamp" => "keystone", "inst" => role.default_attributes["nova_dashboard"]["keystone_instance"] }
answer << { "barclamp" => "nova", "inst" => role.default_attributes["nova_dashboard"]["nova_instance"] }
answer
Expand All @@ -67,7 +64,6 @@ def create_proposal
}
end

base["attributes"][@bc_name]["git_instance"] = find_dep_proposal("git", true)
base["attributes"][@bc_name]["database_instance"] = find_dep_proposal("database")
base["attributes"][@bc_name]["keystone_instance"] = find_dep_proposal("keystone")
base["attributes"][@bc_name]["nova_instance"] = find_dep_proposal("nova")
Expand All @@ -81,10 +77,6 @@ def create_proposal
def validate_proposal_after_save proposal
validate_one_for_role proposal, "nova_dashboard-server"

if proposal["attributes"][@bc_name]["use_gitrepo"]
validate_dep_proposal_is_active "git", proposal["attributes"][@bc_name]["git_instance"]
end

super
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@
= string_field %w(apache ssl_crt_file)
= string_field %w(apache ssl_key_file)
= string_field %w(apache ssl_crt_chain_file)

= render "barclamp/git/pfsdeps"