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

Commit f1e1b9d

Browse files
committed
Merge pull request #214 from vuntz/kill-pfs
[post-tex] Drop PFS support
2 parents 1f930f1 + 18ebf56 commit f1e1b9d

File tree

13 files changed

+45
-118
lines changed

13 files changed

+45
-118
lines changed

chef/cookbooks/nova_dashboard/metadata.rb

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
depends "apache2"
99
depends "database"
1010
depends "nagios"
11-
depends "git"
1211
depends "memcached"
1312
depends "keystone"
1413
depends "crowbar-openstack"

chef/cookbooks/nova_dashboard/recipes/server.rb

+26-52
Original file line numberDiff line numberDiff line change
@@ -27,49 +27,35 @@
2727
include_recipe "apache2::mod_ssl"
2828
end
2929

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

40-
rm_pkgs = [ "openstack-dashboard-ubuntu-theme" ]
41-
rm_pkgs.each do |pkg|
42-
package pkg do
43-
action :purge
44-
end
45-
end
46-
elsif %w(redhat centos).include?(node.platform)
47-
package "openstack-dashboard"
48-
package "python-lesscpy"
49-
package "python-memcached"
50-
else
51-
# On SUSE, the package has the correct list of dependencies
52-
package "openstack-dashboard"
53-
54-
# Install the configured branding
55-
unless node[:nova_dashboard][:site_theme].empty?
56-
package "openstack-dashboard-theme-#{node[:nova_dashboard][:site_theme]}" do
57-
action :install
58-
notifies :reload, resources(:service => "apache2")
59-
end
39+
rm_pkgs = [ "openstack-dashboard-ubuntu-theme" ]
40+
rm_pkgs.each do |pkg|
41+
package pkg do
42+
action :purge
6043
end
6144
end
45+
elsif %w(redhat centos).include?(node.platform)
46+
package "openstack-dashboard"
47+
package "python-lesscpy"
48+
package "python-memcached"
6249
else
63-
venv_path = node[:nova_dashboard][:use_virtualenv] ? "#{dashboard_path}/.venv" : nil
64-
venv_prefix = node[:nova_dashboard][:use_virtualenv] ? ". #{venv_path}/bin/activate &&" : nil
65-
66-
pfs_and_install_deps "nova_dashboard" do
67-
path dashboard_path
68-
virtualenv venv_path
69-
end
70-
71-
execute "chown_#{node[:apache][:user]}" do
72-
command "chown -R #{node[:apache][:user]}:#{node[:apache][:group]} #{dashboard_path}"
50+
# On SUSE, the package has the correct list of dependencies
51+
package "openstack-dashboard"
52+
53+
# Install the configured branding
54+
unless node[:nova_dashboard][:site_theme].empty?
55+
package "openstack-dashboard-theme-#{node[:nova_dashboard][:site_theme]}" do
56+
action :install
57+
notifies :reload, resources(:service => "apache2")
58+
end
7359
end
7460
end
7561

@@ -257,7 +243,7 @@
257243
execute "python manage.py syncdb" do
258244
cwd dashboard_path
259245
environment ({'PYTHONPATH' => dashboard_path})
260-
command "#{venv_prefix} python manage.py syncdb --noinput"
246+
command "python manage.py syncdb --noinput"
261247
user node[:apache][:user]
262248
group node[:apache][:group]
263249
action :nothing
@@ -341,25 +327,13 @@
341327
:use_ssl => node[:nova_dashboard][:apache][:ssl],
342328
:ssl_crt_file => node[:nova_dashboard][:apache][:ssl_crt_file],
343329
:ssl_key_file => node[:nova_dashboard][:apache][:ssl_key_file],
344-
:ssl_crt_chain_file => node[:nova_dashboard][:apache][:ssl_crt_chain_file],
345-
:venv => node[:nova_dashboard][:use_virtualenv] && node[:nova_dashboard][:use_gitrepo],
346-
:venv_path => venv_path
330+
:ssl_crt_chain_file => node[:nova_dashboard][:apache][:ssl_crt_chain_file]
347331
)
348332
if ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/nova-dashboard.conf") or node.platform == "suse"
349333
notifies :reload, resources(:service => "apache2")
350334
end
351335
end
352336

353-
if node[:nova_dashboard][:use_virtualenv] && node[:nova_dashboard][:use_gitrepo]
354-
template "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django_venv.wsgi" do
355-
source "django_venv.wsgi.erb"
356-
mode 0644
357-
variables(
358-
:venv_path => venv_path
359-
)
360-
end
361-
end
362-
363337
apache_site "nova-dashboard.conf" do
364338
enable true
365339
end

chef/cookbooks/nova_dashboard/templates/centos/local_settings.py.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
7070
# behind a load-balancer). Either you have to make sure that a session gets all
7171
# requests routed to the same dashboard instance or you set the same SECRET_KEY
7272
# for all of them.
73-
<% if (node.platform == "suse") or (node.platform == "ubuntu" and node[:nova_dashboard][:use_gitrepo]) -%>
73+
<% if (node.platform == "suse") -%>
7474
from horizon.utils import secret_key
7575
SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
7676
<% end -%>

chef/cookbooks/nova_dashboard/templates/default/django_venv.wsgi.erb

-17
This file was deleted.

chef/cookbooks/nova_dashboard/templates/default/local_settings.py.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
9595
# behind a load-balancer). Either you have to make sure that a session gets all
9696
# requests routed to the same dashboard instance or you set the same SECRET_KEY
9797
# for all of them.
98-
<% if (node.platform == "suse") or (node.platform == "ubuntu" and node[:nova_dashboard][:use_gitrepo]) -%>
98+
<% if (node.platform == "suse") -%>
9999
from horizon.utils import secret_key
100100
SECRET_KEY = secret_key.generate_or_read_from_file(
101101
os.path.join(LOCAL_PATH, '.secret_key_store'))

chef/cookbooks/nova_dashboard/templates/default/nova-dashboard.conf.erb

-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ RewriteRule / https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
2020
<VirtualHost <%= @bind_host %>:<%= @bind_port %>>
2121
<% end %>
2222
WSGIDaemonProcess horizon user=<%= @user %> group=<%= @group %> processes=3 threads=10 home=<%= @horizon_dir %>
23-
<% if @venv -%>
24-
WSGIScriptAlias / <%= @horizon_dir %>/openstack_dashboard/wsgi/django_venv.wsgi
25-
<% else -%>
2623
WSGIScriptAlias / <%= @horizon_dir %>/openstack_dashboard/wsgi/django.wsgi
27-
<% end -%>
2824
SetEnv APACHE_RUN_USER <%= @user %>
2925
SetEnv APACHE_RUN_GROUP <%= @group %>
3026
WSGIProcessGroup horizon

chef/cookbooks/nova_dashboard/templates/redhat/local_settings.py.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
7070
# behind a load-balancer). Either you have to make sure that a session gets all
7171
# requests routed to the same dashboard instance or you set the same SECRET_KEY
7272
# for all of them.
73-
<% if (node.platform == "suse") or (node.platform == "ubuntu" and node[:nova_dashboard][:use_gitrepo]) -%>
73+
<% if (node.platform == "suse") -%>
7474
from horizon.utils import secret_key
7575
SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
7676
<% end -%>

chef/data_bags/crowbar/bc-template-nova_dashboard.json

+2-19
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,14 @@
2929
"ssl_key_file": "/etc/apache2/ssl.key/openstack-dashboard-server.key",
3030
"ssl_crt_chain_file": ""
3131
},
32-
"external_monitoring": {},
33-
"gitrepo": "http://github.com/openstack/horizon.git",
34-
"git_instance": "",
35-
"git_refspec": "stable/icehouse",
36-
"use_gitbarclamp": true,
37-
"use_pip_cache": true,
38-
"use_virtualenv": true,
39-
"pfs_deps": [
40-
"apache2",
41-
"libapache2-mod-wsgi",
42-
"pip://setuptools-git",
43-
"pip://distribute>=0.6.28",
44-
"pip://MySQL-python",
45-
"pip://python-memcached",
46-
"pip://ply",
47-
"pip://lesscpy"
48-
],
49-
"use_gitrepo": false
32+
"external_monitoring": {}
5033
}
5134
},
5235
"deployment": {
5336
"nova_dashboard": {
5437
"crowbar-revision": 0,
5538
"crowbar-applied": false,
56-
"schema-revision": 21,
39+
"schema-revision": 30,
5740
"element_states": {
5841
"nova_dashboard-server": [ "readying", "ready", "applying" ]
5942
},

chef/data_bags/crowbar/bc-template-nova_dashboard.schema

+1-9
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,7 @@
5454
"mapping": {
5555
=: { "type": "str", "required": false }
5656
}
57-
},
58-
"gitrepo": { "type": "str", "required": true },
59-
"git_instance": { "type": "str", "required": true },
60-
"git_refspec": { "type": "str", "required": true },
61-
"use_gitrepo": { "type": "bool", "required": true },
62-
"use_gitbarclamp": { "type": "bool", "required": true },
63-
"use_pip_cache": { "type": "bool", "required": true },
64-
"use_virtualenv": { "type": "bool", "required": true },
65-
"pfs_deps": { "type": "seq", "required": true, "sequence": [ { "type": "str" } ] }
57+
}
6658
}
6759
}
6860
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def upgrade ta, td, a, d
2+
%w(gitrepo git_instance git_refspec use_gitbarclamp use_pip_cache use_gitrepo use_virtualenv pfs_deps).each do |attr|
3+
a.delete(attr)
4+
end
5+
return a, d
6+
end
7+
8+
def downgrade ta, td, a, d
9+
%w(gitrepo git_instance git_refspec use_gitbarclamp use_pip_cache use_gitrepo use_virtualenv pfs_deps).each do |attr|
10+
a[attr] = ta[attr]
11+
end
12+
return a, d
13+
end

crowbar.yml

-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,3 @@ crowbar:
3535
run_order: 96
3636
chef_order: 96
3737
proposal_schema_version: 3
38-
39-
git_repo:
40-
- 'nova_dashboard https://github.com/openstack/horizon.git stable/juno'

crowbar_framework/app/models/nova_dashboard_service.rb

-8
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ def role_constraints
4646
def proposal_dependencies(role)
4747
answer = []
4848
answer << { "barclamp" => "database", "inst" => role.default_attributes["nova_dashboard"]["database_instance"] }
49-
if role.default_attributes[@bc_name]["use_gitrepo"]
50-
answer << { "barclamp" => "git", "inst" => role.default_attributes[@bc_name]["git_instance"] }
51-
end
5249
answer << { "barclamp" => "keystone", "inst" => role.default_attributes["nova_dashboard"]["keystone_instance"] }
5350
answer << { "barclamp" => "nova", "inst" => role.default_attributes["nova_dashboard"]["nova_instance"] }
5451
answer
@@ -67,7 +64,6 @@ def create_proposal
6764
}
6865
end
6966

70-
base["attributes"][@bc_name]["git_instance"] = find_dep_proposal("git", true)
7167
base["attributes"][@bc_name]["database_instance"] = find_dep_proposal("database")
7268
base["attributes"][@bc_name]["keystone_instance"] = find_dep_proposal("keystone")
7369
base["attributes"][@bc_name]["nova_instance"] = find_dep_proposal("nova")
@@ -81,10 +77,6 @@ def create_proposal
8177
def validate_proposal_after_save proposal
8278
validate_one_for_role proposal, "nova_dashboard-server"
8379

84-
if proposal["attributes"][@bc_name]["use_gitrepo"]
85-
validate_dep_proposal_is_active "git", proposal["attributes"][@bc_name]["git_instance"]
86-
end
87-
8880
super
8981
end
9082

crowbar_framework/app/views/barclamp/nova_dashboard/_edit_attributes.html.haml

-2
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,3 @@
2626
= string_field %w(apache ssl_crt_file)
2727
= string_field %w(apache ssl_key_file)
2828
= string_field %w(apache ssl_crt_chain_file)
29-
30-
= render "barclamp/git/pfsdeps"

0 commit comments

Comments
 (0)