Merge lp:~yolanda.robla/horizon/precise-security into lp:ubuntu/precise-security/horizon

Proposed by Yolanda Robla
Status: Merged
Approved by: James Page
Approved revision: 30
Merge reported by: James Page
Merged at revision: not available
Proposed branch: lp:~yolanda.robla/horizon/precise-security
Merge into: lp:ubuntu/precise-security/horizon
Diff against target: 4012 lines (+794/-1547)
41 files modified
.bzrignore (+0/-12)
.mailmap (+0/-8)
.pc/CVE-2012-3540.patch/horizon/views/auth_forms.py (+0/-190)
.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py (+0/-31)
.pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example (+0/-117)
.pc/allow_alternate_css.patch/horizon/templatetags/branding.py (+0/-62)
.pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html (+0/-6)
.pc/applied-patches (+0/-9)
.pc/fix-coverage-binary-name.patch/run_tests.sh (+0/-403)
.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi (+0/-15)
.pc/fix-dashboard-manage.patch/manage.py (+0/-12)
.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py (+0/-96)
.pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example (+0/-123)
.pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example (+0/-123)
.pylintrc (+0/-42)
AUTHORS (+2/-0)
PKG-INFO (+126/-0)
debian/changelog (+18/-0)
debian/patches/CVE-2012-3540.patch (+0/-33)
debian/patches/series (+0/-1)
horizon.egg-info/PKG-INFO (+126/-0)
horizon.egg-info/SOURCES.txt (+478/-0)
horizon.egg-info/dependency_links.txt (+3/-0)
horizon.egg-info/not-zip-safe (+1/-0)
horizon.egg-info/requires.txt (+18/-0)
horizon.egg-info/top_level.txt (+2/-0)
horizon/dashboards/nova/images_and_snapshots/images/tables.py (+3/-0)
horizon/dashboards/nova/instances_and_volumes/volumes/tables.py (+1/-1)
horizon/dashboards/settings/juju/__init__.py (+0/-1)
horizon/dashboards/settings/juju/forms.py (+0/-96)
horizon/dashboards/settings/juju/panel.py (+0/-28)
horizon/dashboards/settings/juju/urls.py (+0/-24)
horizon/dashboards/settings/juju/views.py (+0/-28)
horizon/dashboards/settings/templates/settings/juju/download_form.html (+0/-20)
horizon/dashboards/settings/templates/settings/juju/environments.yaml.template (+0/-21)
horizon/dashboards/settings/templates/settings/juju/index.html (+0/-11)
horizon/usage/base.py (+9/-6)
horizon/version.py (+1/-1)
setup.cfg (+5/-0)
tools/pip-requires (+1/-1)
tox.ini (+0/-26)
To merge this branch: bzr merge lp:~yolanda.robla/horizon/precise-security
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+160649@code.launchpad.net

Description of the change

Essex SRU

To post a comment you must log in.
30. By Yolanda Robla

updated changelog

Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file '.bzrignore'
--- .bzrignore 2012-08-24 03:27:33 +0000
+++ .bzrignore 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1horizon/.installed.cfg
2horizon/bin
3horizon/develop-eggs/
4horizon/downloads/
5horizon/eggs/
6horizon/parts/
7horizon/src/django_nova.egg-info
8horizon/src/django_openstack.egg-info
9django-nova-syspanel/src/django_nova_syspanel.egg-info
10openstack-dashboard/.dashboard-venv
11openstack-dashboard/local/dashboard_openstack.sqlite3
12openstack-dashboard/local/local_settings.py
130
=== removed file '.mailmap'
--- .mailmap 2012-08-24 03:27:33 +0000
+++ .mailmap 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1# Format is:
2# <preferred e-mail> <other e-mail 1>
3# <preferred e-mail> <other e-mail 2>
4<ghe@debian.org> <ghe.rivero@stackops.com>
5<jake@ansolabs.com> <admin@jakedahn.com>
6<launchpad@markgius.com> <mgius7096@gmail.com>
7<yorik.sar@gmail.com> <yorik@ytaraday>
8<jeblair@hp.com> <james.blair@rackspace.com>
90
=== removed directory '.pc/CVE-2012-3540.patch'
=== removed directory '.pc/CVE-2012-3540.patch/horizon'
=== removed directory '.pc/CVE-2012-3540.patch/horizon/views'
=== removed file '.pc/CVE-2012-3540.patch/horizon/views/auth_forms.py'
--- .pc/CVE-2012-3540.patch/horizon/views/auth_forms.py 2012-08-30 17:15:04 +0000
+++ .pc/CVE-2012-3540.patch/horizon/views/auth_forms.py 1970-01-01 00:00:00 +0000
@@ -1,190 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.
5# All Rights Reserved.
6#
7# Copyright 2012 Nebula, Inc.
8#
9# Licensed under the Apache License, Version 2.0 (the "License"); you may
10# not use this file except in compliance with the License. You may obtain
11# a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18# License for the specific language governing permissions and limitations
19# under the License.
20
21"""
22Forms used for Horizon's auth mechanisms.
23"""
24
25import logging
26
27from django import shortcuts
28from django.conf import settings
29from django.contrib import messages
30from django.contrib.auth import REDIRECT_FIELD_NAME
31from django.utils.translation import ugettext as _
32from keystoneclient import exceptions as keystone_exceptions
33
34from horizon import api
35from horizon import base
36from horizon import exceptions
37from horizon import forms
38from horizon import users
39
40
41LOG = logging.getLogger(__name__)
42
43
44def _set_session_data(request, token):
45 request.session['serviceCatalog'] = token.serviceCatalog
46 request.session['tenant'] = token.tenant['name']
47 request.session['tenant_id'] = token.tenant['id']
48 request.session['token'] = token.id
49 request.session['user_name'] = token.user['name']
50 request.session['user_id'] = token.user['id']
51 request.session['roles'] = token.user['roles']
52
53
54class Login(forms.SelfHandlingForm):
55 """ Form used for logging in a user.
56
57 Handles authentication with Keystone, choosing a tenant, and fetching
58 a scoped token token for that tenant. Redirects to the URL returned
59 by :meth:`horizon.get_user_home` if successful.
60
61 Subclass of :class:`~horizon.forms.SelfHandlingForm`.
62 """
63 region = forms.ChoiceField(label=_("Region"), required=False)
64 username = forms.CharField(label=_("User Name"))
65 password = forms.CharField(label=_("Password"),
66 widget=forms.PasswordInput(render_value=False))
67
68 def __init__(self, *args, **kwargs):
69 super(Login, self).__init__(*args, **kwargs)
70 # FIXME(gabriel): When we switch to region-only settings, we can
71 # remove this default region business.
72 default_region = (settings.OPENSTACK_KEYSTONE_URL, "Default Region")
73 regions = getattr(settings, 'AVAILABLE_REGIONS', [default_region])
74 self.fields['region'].choices = regions
75 if len(regions) == 1:
76 self.fields['region'].initial = default_region[0]
77 self.fields['region'].widget = forms.widgets.HiddenInput()
78
79 def handle(self, request, data):
80 if 'user_name' in request.session:
81 if request.session['user_name'] != data['username']:
82 # To avoid reusing another user's session, create a
83 # new, empty session if the existing session
84 # corresponds to a different authenticated user.
85 request.session.flush()
86 # Always cycle the session key when viewing the login form to
87 # prevent session fixation
88 request.session.cycle_key()
89
90 # For now we'll allow fallback to OPENSTACK_KEYSTONE_URL if the
91 # form post doesn't include a region.
92 endpoint = data.get('region', None) or settings.OPENSTACK_KEYSTONE_URL
93 region_name = dict(self.fields['region'].choices)[endpoint]
94 request.session['region_endpoint'] = endpoint
95 request.session['region_name'] = region_name
96
97 redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, "")
98
99 if data.get('tenant', None):
100 try:
101 token = api.token_create(request,
102 data.get('tenant'),
103 data['username'],
104 data['password'])
105 tenants = api.tenant_list_for_token(request, token.id)
106 except:
107 msg = _('Unable to authenticate for that project.')
108 exceptions.handle(request,
109 message=msg,
110 escalate=True)
111 _set_session_data(request, token)
112 user = users.get_user_from_request(request)
113 redirect = redirect_to or base.Horizon.get_user_home(user)
114 return shortcuts.redirect(redirect)
115
116 elif data.get('username', None):
117 try:
118 unscoped_token = api.token_create(request,
119 '',
120 data['username'],
121 data['password'])
122 except keystone_exceptions.Unauthorized:
123 exceptions.handle(request,
124 _('Invalid user name or password.'))
125 except:
126 # If we get here we don't want to show a stack trace to the
127 # user. However, if we fail here, there may be bad session
128 # data that's been cached already.
129 request.user_logout()
130 exceptions.handle(request,
131 message=_("An error occurred authenticating."
132 " Please try again later."),
133 escalate=True)
134
135 # Unscoped token
136 request.session['unscoped_token'] = unscoped_token.id
137 request.user.username = data['username']
138
139 # Get the tenant list, and log in using first tenant
140 # FIXME (anthony): add tenant chooser here?
141 try:
142 tenants = api.tenant_list_for_token(request, unscoped_token.id)
143 except:
144 exceptions.handle(request)
145 tenants = []
146
147 # Abort if there are no valid tenants for this user
148 if not tenants:
149 messages.error(request,
150 _('You are not authorized for any projects.') %
151 {"user": data['username']},
152 extra_tags="login")
153 return
154
155 # Create a token.
156 # NOTE(gabriel): Keystone can return tenants that you're
157 # authorized to administer but not to log into as a user, so in
158 # the case of an Unauthorized error we should iterate through
159 # the tenants until one succeeds or we've failed them all.
160 while tenants:
161 tenant = tenants.pop()
162 try:
163 token = api.token_create_scoped(request,
164 tenant.id,
165 unscoped_token.id)
166 break
167 except:
168 # This will continue for recognized Unauthorized
169 # exceptions from keystoneclient.
170 exceptions.handle(request, ignore=True)
171 token = None
172 if token is None:
173 raise exceptions.NotAuthorized(
174 _("You are not authorized for any available projects."))
175
176 _set_session_data(request, token)
177 user = users.get_user_from_request(request)
178 redirect = redirect_to or base.Horizon.get_user_home(user)
179 return shortcuts.redirect(redirect)
180
181
182class LoginWithTenant(Login):
183 """
184 Exactly like :class:`.Login` but includes the tenant id as a field
185 so that the process of choosing a default tenant is bypassed.
186 """
187 region = forms.ChoiceField(required=False)
188 username = forms.CharField(max_length="20",
189 widget=forms.TextInput(attrs={'readonly': 'readonly'}))
190 tenant = forms.CharField(widget=forms.HiddenInput())
1910
=== added directory '.pc/add_juju_settings_panel.patch'
=== removed directory '.pc/add_juju_settings_panel.patch'
=== added file '.pc/add_juju_settings_panel.patch/.timestamp'
=== added directory '.pc/add_juju_settings_panel.patch/horizon'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon'
=== added directory '.pc/add_juju_settings_panel.patch/horizon/dashboards'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon/dashboards'
=== added directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py'
--- .pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py 1970-01-01 00:00:00 +0000
+++ .pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,31 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Nebula, Inc.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18from django.utils.translation import ugettext_lazy as _
19
20import horizon
21
22
23class Settings(horizon.Dashboard):
24 name = _("Settings")
25 slug = "settings"
26 panels = ('user', 'project', 'ec2')
27 default_panel = 'user'
28 nav = False
29
30
31horizon.register(Settings)
032
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py'
--- .pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py 2012-04-12 12:42:04 +0000
+++ .pc/add_juju_settings_panel.patch/horizon/dashboards/settings/dashboard.py 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Nebula, Inc.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18from django.utils.translation import ugettext_lazy as _
19
20import horizon
21
22
23class Settings(horizon.Dashboard):
24 name = _("Settings")
25 slug = "settings"
26 panels = ('user', 'project', 'ec2')
27 default_panel = 'user'
28 nav = False
29
30
31horizon.register(Settings)
320
=== added directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/__init__.py'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/__init__.py'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/forms.py'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/forms.py'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/panel.py'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/panel.py'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/urls.py'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/urls.py'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/views.py'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/juju/views.py'
=== added directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates'
=== added directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings'
=== added directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju'
=== removed directory '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju/download_form.html'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju/download_form.html'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju/environments.yaml.template'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju/environments.yaml.template'
=== added file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju/index.html'
=== removed file '.pc/add_juju_settings_panel.patch/horizon/dashboards/settings/templates/settings/juju/index.html'
=== added directory '.pc/add_juju_settings_panel.patch/openstack_dashboard'
=== removed directory '.pc/add_juju_settings_panel.patch/openstack_dashboard'
=== added directory '.pc/add_juju_settings_panel.patch/openstack_dashboard/local'
=== removed directory '.pc/add_juju_settings_panel.patch/openstack_dashboard/local'
=== added file '.pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example'
--- .pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example 1970-01-01 00:00:00 +0000
+++ .pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example 2013-04-24 15:22:28 +0000
@@ -0,0 +1,117 @@
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5DEBUG = True
6TEMPLATE_DEBUG = DEBUG
7PROD = False
8USE_SSL = False
9
10# Note: You should change this value
11SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
12
13# Specify a regular expression to validate user passwords.
14# HORIZON_CONFIG = {
15# "password_validator": {
16# "regex": '.*',
17# "help_text": _("Your password does not meet the requirements.")
18# }
19# }
20
21LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
22
23# We recommend you use memcached for development; otherwise after every reload
24# of the django development server, you will have to login again. To use
25# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
26CACHE_BACKEND = 'locmem://'
27
28# Send email to the console by default
29EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
30# Or send them to /dev/null
31#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
32
33# Configure these for your outgoing email host
34# EMAIL_HOST = 'smtp.my-company.com'
35# EMAIL_PORT = 25
36# EMAIL_HOST_USER = 'djangomail'
37# EMAIL_HOST_PASSWORD = 'top-secret!'
38
39# For multiple regions uncomment this configuration, and add (endpoint, title).
40# AVAILABLE_REGIONS = [
41# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
42# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
43# ]
44
45OPENSTACK_HOST = "127.0.0.1"
46OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
47OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
48
49# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
50# capabilities of the auth backend for Keystone.
51# If Keystone has been configured to use LDAP as the auth backend then set
52# can_edit_user to False and name to 'ldap'.
53#
54# TODO(tres): Remove these once Keystone has an API to identify auth backend.
55OPENSTACK_KEYSTONE_BACKEND = {
56 'name': 'native',
57 'can_edit_user': True
58}
59
60# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
61# in the Keystone service catalog. Use this setting when Horizon is running
62# external to the OpenStack environment. The default is 'internalURL'.
63#OPENSTACK_ENDPOINT_TYPE = "publicURL"
64
65# The number of Swift containers and objects to display on a single page before
66# providing a paging element (a "more" link) to paginate results.
67API_RESULT_LIMIT = 1000
68
69# If you have external monitoring links, eg:
70# EXTERNAL_MONITORING = [
71# ['Nagios','http://foo.com'],
72# ['Ganglia','http://bar.com'],
73# ]
74
75LOGGING = {
76 'version': 1,
77 # When set to True this will disable all logging except
78 # for loggers specified in this configuration dictionary. Note that
79 # if nothing is specified here and disable_existing_loggers is True,
80 # django.db.backends will still log unless it is disabled explicitly.
81 'disable_existing_loggers': False,
82 'handlers': {
83 'null': {
84 'level': 'DEBUG',
85 'class': 'django.utils.log.NullHandler',
86 },
87 'console': {
88 # Set the level to "DEBUG" for verbose output logging.
89 'level': 'INFO',
90 'class': 'logging.StreamHandler',
91 },
92 },
93 'loggers': {
94 # Logging from django.db.backends is VERY verbose, send to null
95 # by default.
96 'django.db.backends': {
97 'handlers': ['null'],
98 'propagate': False,
99 },
100 'horizon': {
101 'handlers': ['console'],
102 'propagate': False,
103 },
104 'novaclient': {
105 'handlers': ['console'],
106 'propagate': False,
107 },
108 'keystoneclient': {
109 'handlers': ['console'],
110 'propagate': False,
111 },
112 'nose.plugins.manager': {
113 'handlers': ['console'],
114 'propagate': False,
115 }
116 }
117}
0118
=== removed file '.pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example'
--- .pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example 2012-04-13 09:58:54 +0000
+++ .pc/add_juju_settings_panel.patch/openstack_dashboard/local/local_settings.py.example 1970-01-01 00:00:00 +0000
@@ -1,117 +0,0 @@
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5DEBUG = True
6TEMPLATE_DEBUG = DEBUG
7PROD = False
8USE_SSL = False
9
10# Note: You should change this value
11SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
12
13# Specify a regular expression to validate user passwords.
14# HORIZON_CONFIG = {
15# "password_validator": {
16# "regex": '.*',
17# "help_text": _("Your password does not meet the requirements.")
18# }
19# }
20
21LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
22
23# We recommend you use memcached for development; otherwise after every reload
24# of the django development server, you will have to login again. To use
25# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
26CACHE_BACKEND = 'locmem://'
27
28# Send email to the console by default
29EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
30# Or send them to /dev/null
31#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
32
33# Configure these for your outgoing email host
34# EMAIL_HOST = 'smtp.my-company.com'
35# EMAIL_PORT = 25
36# EMAIL_HOST_USER = 'djangomail'
37# EMAIL_HOST_PASSWORD = 'top-secret!'
38
39# For multiple regions uncomment this configuration, and add (endpoint, title).
40# AVAILABLE_REGIONS = [
41# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
42# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
43# ]
44
45OPENSTACK_HOST = "127.0.0.1"
46OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
47OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
48
49# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
50# capabilities of the auth backend for Keystone.
51# If Keystone has been configured to use LDAP as the auth backend then set
52# can_edit_user to False and name to 'ldap'.
53#
54# TODO(tres): Remove these once Keystone has an API to identify auth backend.
55OPENSTACK_KEYSTONE_BACKEND = {
56 'name': 'native',
57 'can_edit_user': True
58}
59
60# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
61# in the Keystone service catalog. Use this setting when Horizon is running
62# external to the OpenStack environment. The default is 'internalURL'.
63#OPENSTACK_ENDPOINT_TYPE = "publicURL"
64
65# The number of Swift containers and objects to display on a single page before
66# providing a paging element (a "more" link) to paginate results.
67API_RESULT_LIMIT = 1000
68
69# If you have external monitoring links, eg:
70# EXTERNAL_MONITORING = [
71# ['Nagios','http://foo.com'],
72# ['Ganglia','http://bar.com'],
73# ]
74
75LOGGING = {
76 'version': 1,
77 # When set to True this will disable all logging except
78 # for loggers specified in this configuration dictionary. Note that
79 # if nothing is specified here and disable_existing_loggers is True,
80 # django.db.backends will still log unless it is disabled explicitly.
81 'disable_existing_loggers': False,
82 'handlers': {
83 'null': {
84 'level': 'DEBUG',
85 'class': 'django.utils.log.NullHandler',
86 },
87 'console': {
88 # Set the level to "DEBUG" for verbose output logging.
89 'level': 'INFO',
90 'class': 'logging.StreamHandler',
91 },
92 },
93 'loggers': {
94 # Logging from django.db.backends is VERY verbose, send to null
95 # by default.
96 'django.db.backends': {
97 'handlers': ['null'],
98 'propagate': False,
99 },
100 'horizon': {
101 'handlers': ['console'],
102 'propagate': False,
103 },
104 'novaclient': {
105 'handlers': ['console'],
106 'propagate': False,
107 },
108 'keystoneclient': {
109 'handlers': ['console'],
110 'propagate': False,
111 },
112 'nose.plugins.manager': {
113 'handlers': ['console'],
114 'propagate': False,
115 }
116 }
117}
1180
=== added directory '.pc/allow_alternate_css.patch'
=== removed directory '.pc/allow_alternate_css.patch'
=== added file '.pc/allow_alternate_css.patch/.timestamp'
=== added directory '.pc/allow_alternate_css.patch/horizon'
=== removed directory '.pc/allow_alternate_css.patch/horizon'
=== added directory '.pc/allow_alternate_css.patch/horizon/templatetags'
=== removed directory '.pc/allow_alternate_css.patch/horizon/templatetags'
=== added file '.pc/allow_alternate_css.patch/horizon/templatetags/branding.py'
--- .pc/allow_alternate_css.patch/horizon/templatetags/branding.py 1970-01-01 00:00:00 +0000
+++ .pc/allow_alternate_css.patch/horizon/templatetags/branding.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,62 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.
5# All Rights Reserved.
6#
7# Copyright 2012 Nebula, Inc.
8#
9# Licensed under the Apache License, Version 2.0 (the "License"); you may
10# not use this file except in compliance with the License. You may obtain
11# a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18# License for the specific language governing permissions and limitations
19# under the License.
20
21"""
22Template tags for customizing Horizon.
23"""
24
25from django import template
26from django.conf import settings
27
28
29register = template.Library()
30
31
32class SiteBrandingNode(template.Node):
33 def render(self, context):
34 return settings.SITE_BRANDING
35
36
37@register.tag
38def site_branding(parser, token):
39 return SiteBrandingNode()
40
41
42@register.tag
43def site_title(parser, token):
44 return settings.SITE_BRANDING
45
46
47# TODO(jeffjapan): This is just an assignment tag version of the above, replace
48# when the dashboard is upgraded to a django version that
49# supports the @assignment_tag decorator syntax instead.
50class SaveBrandingNode(template.Node):
51 def __init__(self, var_name):
52 self.var_name = var_name
53
54 def render(self, context):
55 context[self.var_name] = settings.SITE_BRANDING
56 return ""
57
58
59@register.tag
60def save_site_branding(parser, token):
61 tagname = token.contents.split()
62 return SaveBrandingNode(tagname[-1])
063
=== removed file '.pc/allow_alternate_css.patch/horizon/templatetags/branding.py'
--- .pc/allow_alternate_css.patch/horizon/templatetags/branding.py 2012-04-23 10:04:39 +0000
+++ .pc/allow_alternate_css.patch/horizon/templatetags/branding.py 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.
5# All Rights Reserved.
6#
7# Copyright 2012 Nebula, Inc.
8#
9# Licensed under the Apache License, Version 2.0 (the "License"); you may
10# not use this file except in compliance with the License. You may obtain
11# a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18# License for the specific language governing permissions and limitations
19# under the License.
20
21"""
22Template tags for customizing Horizon.
23"""
24
25from django import template
26from django.conf import settings
27
28
29register = template.Library()
30
31
32class SiteBrandingNode(template.Node):
33 def render(self, context):
34 return settings.SITE_BRANDING
35
36
37@register.tag
38def site_branding(parser, token):
39 return SiteBrandingNode()
40
41
42@register.tag
43def site_title(parser, token):
44 return settings.SITE_BRANDING
45
46
47# TODO(jeffjapan): This is just an assignment tag version of the above, replace
48# when the dashboard is upgraded to a django version that
49# supports the @assignment_tag decorator syntax instead.
50class SaveBrandingNode(template.Node):
51 def __init__(self, var_name):
52 self.var_name = var_name
53
54 def render(self, context):
55 context[self.var_name] = settings.SITE_BRANDING
56 return ""
57
58
59@register.tag
60def save_site_branding(parser, token):
61 tagname = token.contents.split()
62 return SaveBrandingNode(tagname[-1])
630
=== added directory '.pc/allow_alternate_css.patch/openstack_dashboard'
=== removed directory '.pc/allow_alternate_css.patch/openstack_dashboard'
=== added directory '.pc/allow_alternate_css.patch/openstack_dashboard/templates'
=== removed directory '.pc/allow_alternate_css.patch/openstack_dashboard/templates'
=== added file '.pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html'
--- .pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html 1970-01-01 00:00:00 +0000
+++ .pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html 2013-04-24 15:22:28 +0000
@@ -0,0 +1,6 @@
1{% comment %} CSS {% endcomment %}
2<link href='{{ STATIC_URL }}bootstrap/css/bootstrap.min.css' media='screen' rel='stylesheet' />
3<link href='{{ STATIC_URL }}dashboard/css/style.css' media='screen' rel='stylesheet' />
4
5{% comment %} Favicon {% endcomment %}
6<link rel="shortcut icon" href="{{ STATIC_URL }}dashboard/img/favicon.ico"/>
07
=== removed file '.pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html'
--- .pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html 2012-04-23 10:04:39 +0000
+++ .pc/allow_alternate_css.patch/openstack_dashboard/templates/_stylesheets.html 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1{% comment %} CSS {% endcomment %}
2<link href='{{ STATIC_URL }}bootstrap/css/bootstrap.min.css' media='screen' rel='stylesheet' />
3<link href='{{ STATIC_URL }}dashboard/css/style.css' media='screen' rel='stylesheet' />
4
5{% comment %} Favicon {% endcomment %}
6<link rel="shortcut icon" href="{{ STATIC_URL }}dashboard/img/favicon.ico"/>
70
=== added file '.pc/applied-patches'
--- .pc/applied-patches 1970-01-01 00:00:00 +0000
+++ .pc/applied-patches 2013-04-24 15:22:28 +0000
@@ -0,0 +1,8 @@
1fix-dashboard-django-wsgi.patch
2fix-dashboard-manage.patch
3fix-coverage-binary-name.patch
4add_juju_settings_panel.patch
5turn-off-debug.patch
6allow_alternate_css.patch
7use-memcache.patch
8juju_panel-handle_catalog_exception.patch
09
=== removed file '.pc/applied-patches'
--- .pc/applied-patches 2012-08-30 17:15:04 +0000
+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1fix-dashboard-django-wsgi.patch
2fix-dashboard-manage.patch
3fix-coverage-binary-name.patch
4add_juju_settings_panel.patch
5turn-off-debug.patch
6allow_alternate_css.patch
7use-memcache.patch
8juju_panel-handle_catalog_exception.patch
9CVE-2012-3540.patch
100
=== added directory '.pc/fix-coverage-binary-name.patch'
=== removed directory '.pc/fix-coverage-binary-name.patch'
=== added file '.pc/fix-coverage-binary-name.patch/.timestamp'
=== added file '.pc/fix-coverage-binary-name.patch/run_tests.sh'
--- .pc/fix-coverage-binary-name.patch/run_tests.sh 1970-01-01 00:00:00 +0000
+++ .pc/fix-coverage-binary-name.patch/run_tests.sh 2013-04-24 15:22:28 +0000
@@ -0,0 +1,403 @@
1#!/bin/bash
2
3set -o errexit
4
5# ---------------UPDATE ME-------------------------------#
6# Increment me any time the environment should be rebuilt.
7# This includes dependncy changes, directory renames, etc.
8# Simple integer secuence: 1, 2, 3...
9environment_version=14
10#--------------------------------------------------------#
11
12function usage {
13 echo "Usage: $0 [OPTION]..."
14 echo "Run Horizon's test suite(s)"
15 echo ""
16 echo " -V, --virtual-env Always use virtualenv. Install automatically"
17 echo " if not present"
18 echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local"
19 echo " environment"
20 echo " -c, --coverage Generate reports using Coverage"
21 echo " -f, --force Force a clean re-build of the virtual"
22 echo " environment. Useful when dependencies have"
23 echo " been added."
24 echo " -m, --makemessages Update all translation files."
25 echo " -p, --pep8 Just run pep8"
26 echo " -t, --tabs Check for tab characters in files."
27 echo " -y, --pylint Just run pylint"
28 echo " -q, --quiet Run non-interactively. (Relatively) quiet."
29 echo " Implies -V if -N is not set."
30 echo " --only-selenium Run only the Selenium unit tests"
31 echo " --with-selenium Run unit tests including Selenium tests"
32 echo " --runserver Run the Django development server for"
33 echo " openstack_dashboard in the virtual"
34 echo " environment."
35 echo " --docs Just build the documentation"
36 echo " --backup-environment Make a backup of the environment on exit"
37 echo " --restore-environment Restore the environment before running"
38 echo " --destroy-environment DEstroy the environment and exit"
39 echo " -h, --help Print this usage message"
40 echo ""
41 echo "Note: with no options specified, the script will try to run the tests in"
42 echo " a virtual environment, If no virtualenv is found, the script will ask"
43 echo " if you would like to create one. If you prefer to run tests NOT in a"
44 echo " virtual environment, simply pass the -N option."
45 exit
46}
47
48# DEFAULTS FOR RUN_TESTS.SH
49#
50root=`pwd`
51venv=$root/.venv
52with_venv=tools/with_venv.sh
53included_dirs="openstack_dashboard horizon"
54
55always_venv=0
56backup_env=0
57command_wrapper=""
58destroy=0
59force=0
60just_pep8=0
61just_pylint=0
62just_docs=0
63just_tabs=0
64never_venv=0
65quiet=0
66restore_env=0
67runserver=0
68only_selenium=0
69with_selenium=0
70testargs=""
71with_coverage=0
72makemessages=0
73
74# Jenkins sets a "JOB_NAME" variable, if it's not set, we'll make it "default"
75[ "$JOB_NAME" ] || JOB_NAME="default"
76
77function process_option {
78 case "$1" in
79 -h|--help) usage;;
80 -V|--virtual-env) always_venv=1; never_venv=0;;
81 -N|--no-virtual-env) always_venv=0; never_venv=1;;
82 -p|--pep8) just_pep8=1;;
83 -y|--pylint) just_pylint=1;;
84 -f|--force) force=1;;
85 -t|--tabs) just_tabs=1;;
86 -q|--quiet) quiet=1;;
87 -c|--coverage) with_coverage=1;;
88 -m|--makemessages) makemessages=1;;
89 --only-selenium) only_selenium=1; with_selenium=1;;
90 --with-selenium) with_selenium=1;;
91 --docs) just_docs=1;;
92 --runserver) runserver=1;;
93 --backup-environment) backup_env=1;;
94 --restore-environment) restore_env=1;;
95 --destroy-environment) destroy=1;;
96 *) testargs="$testargs $1"
97 esac
98}
99
100function run_server {
101 echo "Starting Django development server..."
102 ${command_wrapper} python $root/manage.py runserver $testargs
103 echo "Server stopped."
104}
105
106function run_pylint {
107 echo "Running pylint ..."
108 PYTHONPATH=$root ${command_wrapper} pylint --rcfile=.pylintrc -f parseable $included_dirs > pylint.txt || true
109 CODE=$?
110 grep Global -A2 pylint.txt
111 if [ $CODE -lt 32 ]; then
112 echo "Completed successfully."
113 exit 0
114 else
115 echo "Completed with problems."
116 exit $CODE
117 fi
118}
119
120function run_pep8 {
121 echo "Running pep8 ..."
122 rm -f pep8.txt
123 PEP8_EXCLUDE=vcsversion.py
124 PEP8_IGNORE=W602
125 PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --ignore=$PEP8_IGNORE --repeat"
126 ${command_wrapper} pep8 $PEP8_OPTIONS $included_dirs > pep8.txt || true
127 PEP8_COUNT=`wc -l pep8.txt | awk '{ print $1 }'`
128 if [ $PEP8_COUNT -ge 1 ]; then
129 echo "PEP8 violations found ($PEP8_COUNT):"
130 cat pep8.txt
131 echo "Please fix all PEP8 violations before committing."
132 else
133 echo "No violations found. Good job!"
134 fi
135 exit $PEP8_COUNT
136}
137
138function run_sphinx {
139 echo "Building sphinx..."
140 export DJANGO_SETTINGS_MODULE=openstack_dashboard.settings
141 ${command_wrapper} sphinx-build -b html docs/source docs/build/html
142 echo "Build complete."
143}
144
145function tab_check {
146 TAB_VIOLATIONS=`find $included_dirs -type f -regex ".*\.\(css\|js\|py\|html\)" -print0 | xargs -0 awk '/\t/' | wc -l`
147 if [ $TAB_VIOLATIONS -gt 0 ]; then
148 echo "TABS! $TAB_VIOLATIONS of them! Oh no!"
149 HORIZON_FILES=`find $included_dirs -type f -regex ".*\.\(css\|js\|py|\html\)"`
150 for TABBED_FILE in $HORIZON_FILES
151 do
152 TAB_COUNT=`awk '/\t/' $TABBED_FILE | wc -l`
153 if [ $TAB_COUNT -gt 0 ]; then
154 echo "$TABBED_FILE: $TAB_COUNT"
155 fi
156 done
157 fi
158 return $TAB_VIOLATIONS;
159}
160
161function destroy_venv {
162 echo "Cleaning environment..."
163 echo "Removing virtualenv..."
164 rm -rf $venv
165 echo "Virtualenv removed."
166 rm -f .environment_version
167 echo "Environment cleaned."
168}
169
170function environment_check {
171 echo "Checking environment."
172 if [ -f .environment_version ]; then
173 ENV_VERS=`cat .environment_version`
174 if [ $ENV_VERS -eq $environment_version ]; then
175 if [ -e ${venv} ]; then
176 # If the environment exists and is up-to-date then set our variables
177 command_wrapper="${root}/${with_venv}"
178 echo "Environment is up to date."
179 return 0
180 fi
181 fi
182 fi
183
184 if [ $always_venv -eq 1 ]; then
185 install_venv
186 else
187 if [ ! -e ${venv} ]; then
188 echo -e "Environment not found. Install? (Y/n) \c"
189 else
190 echo -e "Your environment appears to be out of date. Update? (Y/n) \c"
191 fi
192 read update_env
193 if [ "x$update_env" = "xY" -o "x$update_env" = "x" -o "x$update_env" = "xy" ]; then
194 install_venv
195 fi
196 fi
197}
198
199function sanity_check {
200 # Anything that should be determined prior to running the tests, server, etc.
201 # Don't sanity-check anything environment-related in -N flag is set
202 if [ $never_venv -eq 0 ]; then
203 if [ ! -e ${venv} ]; then
204 echo "Virtualenv not found at $venv. Did install_venv.py succeed?"
205 exit 1
206 fi
207 fi
208 if [ $with_selenium -eq 1 ]; then
209 SELENIUM_JOB=`ps -elf | grep "selenium" | grep -v grep`
210 if [ $? -eq 0 ]; then
211 echo "WARNING: Selenium doesn't appear to be running. Please start a selenium server process."
212 with_selenium=0
213 fi
214 fi
215 if [ $only_selenium -eq 1 ]; then
216 export SKIP_UNITTESTS=1
217 fi
218 # Remove .pyc files. This is sanity checking because they can linger
219 # after old files are deleted.
220 find . -name "*.pyc" -exec rm -rf {} \;
221}
222
223function backup_environment {
224 if [ $backup_env -eq 1 ]; then
225 echo "Backing up environment \"$JOB_NAME\"..."
226 if [ ! -e ${venv} ]; then
227 echo "Environment not installed. Cannot back up."
228 return 0
229 fi
230 if [ -d /tmp/.horizon_environment/$JOB_NAME ]; then
231 mv /tmp/.horizon_environment/$JOB_NAME /tmp/.horizon_environment/$JOB_NAME.old
232 rm -rf /tmp/.horizon_environment/$JOB_NAME
233 fi
234 mkdir -p /tmp/.horizon_environment/$JOB_NAME
235 cp -r $venv /tmp/.horizon_environment/$JOB_NAME/
236 cp .environment_version /tmp/.horizon_environment/$JOB_NAME/
237 # Remove the backup now that we've completed successfully
238 rm -rf /tmp/.horizon_environment/$JOB_NAME.old
239 echo "Backup completed"
240 fi
241}
242
243function restore_environment {
244 if [ $restore_env -eq 1 ]; then
245 echo "Restoring environment from backup..."
246 if [ ! -d /tmp/.horizon_environment/$JOB_NAME ]; then
247 echo "No backup to restore from."
248 return 0
249 fi
250
251 cp -r /tmp/.horizon_environment/$JOB_NAME/.venv ./ || true
252 cp -r /tmp/.horizon_environment/$JOB_NAME/.environment_version ./ || true
253
254 echo "Environment restored successfully."
255 fi
256}
257
258function install_venv {
259 # Install with install_venv.py
260 export PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE-/tmp/.pip_download_cache}
261 export PIP_USE_MIRRORS=true
262 if [ $quiet -eq 1 ]; then
263 export PIP_NO_INPUT=true
264 fi
265 echo "Fetching new src packages..."
266 rm -rf $venv/src
267 python tools/install_venv.py
268 command_wrapper="$root/${with_venv}"
269 # Make sure it worked and record the environment version
270 sanity_check
271 chmod -R 754 $venv
272 echo $environment_version > .environment_version
273}
274
275function run_tests {
276 sanity_check
277
278 echo "Running Horizon application tests"
279 export NOSE_XUNIT_FILE=horizon/nosetests.xml
280 ${command_wrapper} coverage erase
281 ${command_wrapper} coverage run -p $root/manage.py test horizon --settings=horizon.tests.testsettings $testargs
282 # get results of the Horizon tests
283 HORIZON_RESULT=$?
284
285 echo "Running openstack_dashboard tests"
286 export NOSE_XUNIT_FILE=openstack_dashboard/nosetests.xml
287 if [ $with_selenium -eq 1 ]; then
288 ${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=horizon.tests.testsettings --with-selenium --with-cherrypyliveserver $testargs
289 else
290 ${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=horizon.tests.testsettings $testargs
291 fi
292 # get results of the openstack_dashboard tests
293 DASHBOARD_RESULT=$?
294
295 if [ $with_coverage -eq 1 ]; then
296 echo "Generating coverage reports"
297 ${command_wrapper} coverage combine
298 ${command_wrapper} coverage xml -i --omit='/usr*,setup.py,*egg*,.venv/*'
299 ${command_wrapper} coverage html -i --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
300 fi
301 # Remove the leftover coverage files from the -p flag earlier.
302 rm -f .coverage.*
303
304 if [ $(($HORIZON_RESULT || $DASHBOARD_RESULT)) -eq 0 ]; then
305 echo "Tests completed successfully."
306 else
307 echo "Tests failed."
308 fi
309 exit $(($HORIZON_RESULT || $DASHBOARD_RESULT))
310}
311
312function run_makemessages {
313 cd horizon
314 ${command_wrapper} $root/manage.py makemessages --all
315 HORIZON_RESULT=$?
316 cd ../openstack_dashboard
317 ${command_wrapper} $root/manage.py makemessages --all
318 DASHBOARD_RESULT=$?
319 cd ..
320 exit $(($HORIZON_RESULT || $DASHBOARD_RESULT))
321}
322
323
324# ---------PREPARE THE ENVIRONMENT------------ #
325
326# PROCESS ARGUMENTS, OVERRIDE DEFAULTS
327for arg in "$@"; do
328 process_option $arg
329done
330
331if [ $quiet -eq 1 ] && [ $never_venv -eq 0 ] && [ $always_venv -eq 0 ]
332then
333 always_venv=1
334fi
335
336# If destroy is set, just blow it away and exit.
337if [ $destroy -eq 1 ]; then
338 destroy_venv
339 exit 0
340fi
341
342# Ignore all of this if the -N flag was set
343if [ $never_venv -eq 0 ]; then
344
345 # Restore previous environment if desired
346 if [ $restore_env -eq 1 ]; then
347 restore_environment
348 fi
349
350 # Remove the virtual environment if --force used
351 if [ $force -eq 1 ]; then
352 destroy_venv
353 fi
354
355 # Then check if it's up-to-date
356 environment_check
357
358 # Create a backup of the up-to-date environment if desired
359 if [ $backup_env -eq 1 ]; then
360 backup_environment
361 fi
362fi
363
364# ---------EXERCISE THE CODE------------ #
365
366# Build the docs
367if [ $just_docs -eq 1 ]; then
368 run_sphinx
369 exit $?
370fi
371
372# Update translation files
373if [ $makemessages -eq 1 ]; then
374 run_makemessages
375 exit $?
376fi
377
378# PEP8
379if [ $just_pep8 -eq 1 ]; then
380 run_pep8
381 exit $?
382fi
383
384# Pylint
385if [ $just_pylint -eq 1 ]; then
386 run_pylint
387 exit $?
388fi
389
390# Tab checker
391if [ $just_tabs -eq 1 ]; then
392 tab_check
393 exit $?
394fi
395
396# Django development server
397if [ $runserver -eq 1 ]; then
398 run_server
399 exit $?
400fi
401
402# Full test suite
403run_tests || exit
0404
=== removed file '.pc/fix-coverage-binary-name.patch/run_tests.sh'
--- .pc/fix-coverage-binary-name.patch/run_tests.sh 2012-08-24 03:27:33 +0000
+++ .pc/fix-coverage-binary-name.patch/run_tests.sh 1970-01-01 00:00:00 +0000
@@ -1,403 +0,0 @@
1#!/bin/bash
2
3set -o errexit
4
5# ---------------UPDATE ME-------------------------------#
6# Increment me any time the environment should be rebuilt.
7# This includes dependncy changes, directory renames, etc.
8# Simple integer secuence: 1, 2, 3...
9environment_version=14
10#--------------------------------------------------------#
11
12function usage {
13 echo "Usage: $0 [OPTION]..."
14 echo "Run Horizon's test suite(s)"
15 echo ""
16 echo " -V, --virtual-env Always use virtualenv. Install automatically"
17 echo " if not present"
18 echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local"
19 echo " environment"
20 echo " -c, --coverage Generate reports using Coverage"
21 echo " -f, --force Force a clean re-build of the virtual"
22 echo " environment. Useful when dependencies have"
23 echo " been added."
24 echo " -m, --makemessages Update all translation files."
25 echo " -p, --pep8 Just run pep8"
26 echo " -t, --tabs Check for tab characters in files."
27 echo " -y, --pylint Just run pylint"
28 echo " -q, --quiet Run non-interactively. (Relatively) quiet."
29 echo " Implies -V if -N is not set."
30 echo " --only-selenium Run only the Selenium unit tests"
31 echo " --with-selenium Run unit tests including Selenium tests"
32 echo " --runserver Run the Django development server for"
33 echo " openstack_dashboard in the virtual"
34 echo " environment."
35 echo " --docs Just build the documentation"
36 echo " --backup-environment Make a backup of the environment on exit"
37 echo " --restore-environment Restore the environment before running"
38 echo " --destroy-environment DEstroy the environment and exit"
39 echo " -h, --help Print this usage message"
40 echo ""
41 echo "Note: with no options specified, the script will try to run the tests in"
42 echo " a virtual environment, If no virtualenv is found, the script will ask"
43 echo " if you would like to create one. If you prefer to run tests NOT in a"
44 echo " virtual environment, simply pass the -N option."
45 exit
46}
47
48# DEFAULTS FOR RUN_TESTS.SH
49#
50root=`pwd`
51venv=$root/.venv
52with_venv=tools/with_venv.sh
53included_dirs="openstack_dashboard horizon"
54
55always_venv=0
56backup_env=0
57command_wrapper=""
58destroy=0
59force=0
60just_pep8=0
61just_pylint=0
62just_docs=0
63just_tabs=0
64never_venv=0
65quiet=0
66restore_env=0
67runserver=0
68only_selenium=0
69with_selenium=0
70testargs=""
71with_coverage=0
72makemessages=0
73
74# Jenkins sets a "JOB_NAME" variable, if it's not set, we'll make it "default"
75[ "$JOB_NAME" ] || JOB_NAME="default"
76
77function process_option {
78 case "$1" in
79 -h|--help) usage;;
80 -V|--virtual-env) always_venv=1; never_venv=0;;
81 -N|--no-virtual-env) always_venv=0; never_venv=1;;
82 -p|--pep8) just_pep8=1;;
83 -y|--pylint) just_pylint=1;;
84 -f|--force) force=1;;
85 -t|--tabs) just_tabs=1;;
86 -q|--quiet) quiet=1;;
87 -c|--coverage) with_coverage=1;;
88 -m|--makemessages) makemessages=1;;
89 --only-selenium) only_selenium=1; with_selenium=1;;
90 --with-selenium) with_selenium=1;;
91 --docs) just_docs=1;;
92 --runserver) runserver=1;;
93 --backup-environment) backup_env=1;;
94 --restore-environment) restore_env=1;;
95 --destroy-environment) destroy=1;;
96 *) testargs="$testargs $1"
97 esac
98}
99
100function run_server {
101 echo "Starting Django development server..."
102 ${command_wrapper} python $root/manage.py runserver $testargs
103 echo "Server stopped."
104}
105
106function run_pylint {
107 echo "Running pylint ..."
108 PYTHONPATH=$root ${command_wrapper} pylint --rcfile=.pylintrc -f parseable $included_dirs > pylint.txt || true
109 CODE=$?
110 grep Global -A2 pylint.txt
111 if [ $CODE -lt 32 ]; then
112 echo "Completed successfully."
113 exit 0
114 else
115 echo "Completed with problems."
116 exit $CODE
117 fi
118}
119
120function run_pep8 {
121 echo "Running pep8 ..."
122 rm -f pep8.txt
123 PEP8_EXCLUDE=vcsversion.py
124 PEP8_IGNORE=W602
125 PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --ignore=$PEP8_IGNORE --repeat"
126 ${command_wrapper} pep8 $PEP8_OPTIONS $included_dirs > pep8.txt || true
127 PEP8_COUNT=`wc -l pep8.txt | awk '{ print $1 }'`
128 if [ $PEP8_COUNT -ge 1 ]; then
129 echo "PEP8 violations found ($PEP8_COUNT):"
130 cat pep8.txt
131 echo "Please fix all PEP8 violations before committing."
132 else
133 echo "No violations found. Good job!"
134 fi
135 exit $PEP8_COUNT
136}
137
138function run_sphinx {
139 echo "Building sphinx..."
140 export DJANGO_SETTINGS_MODULE=openstack_dashboard.settings
141 ${command_wrapper} sphinx-build -b html docs/source docs/build/html
142 echo "Build complete."
143}
144
145function tab_check {
146 TAB_VIOLATIONS=`find $included_dirs -type f -regex ".*\.\(css\|js\|py\|html\)" -print0 | xargs -0 awk '/\t/' | wc -l`
147 if [ $TAB_VIOLATIONS -gt 0 ]; then
148 echo "TABS! $TAB_VIOLATIONS of them! Oh no!"
149 HORIZON_FILES=`find $included_dirs -type f -regex ".*\.\(css\|js\|py|\html\)"`
150 for TABBED_FILE in $HORIZON_FILES
151 do
152 TAB_COUNT=`awk '/\t/' $TABBED_FILE | wc -l`
153 if [ $TAB_COUNT -gt 0 ]; then
154 echo "$TABBED_FILE: $TAB_COUNT"
155 fi
156 done
157 fi
158 return $TAB_VIOLATIONS;
159}
160
161function destroy_venv {
162 echo "Cleaning environment..."
163 echo "Removing virtualenv..."
164 rm -rf $venv
165 echo "Virtualenv removed."
166 rm -f .environment_version
167 echo "Environment cleaned."
168}
169
170function environment_check {
171 echo "Checking environment."
172 if [ -f .environment_version ]; then
173 ENV_VERS=`cat .environment_version`
174 if [ $ENV_VERS -eq $environment_version ]; then
175 if [ -e ${venv} ]; then
176 # If the environment exists and is up-to-date then set our variables
177 command_wrapper="${root}/${with_venv}"
178 echo "Environment is up to date."
179 return 0
180 fi
181 fi
182 fi
183
184 if [ $always_venv -eq 1 ]; then
185 install_venv
186 else
187 if [ ! -e ${venv} ]; then
188 echo -e "Environment not found. Install? (Y/n) \c"
189 else
190 echo -e "Your environment appears to be out of date. Update? (Y/n) \c"
191 fi
192 read update_env
193 if [ "x$update_env" = "xY" -o "x$update_env" = "x" -o "x$update_env" = "xy" ]; then
194 install_venv
195 fi
196 fi
197}
198
199function sanity_check {
200 # Anything that should be determined prior to running the tests, server, etc.
201 # Don't sanity-check anything environment-related in -N flag is set
202 if [ $never_venv -eq 0 ]; then
203 if [ ! -e ${venv} ]; then
204 echo "Virtualenv not found at $venv. Did install_venv.py succeed?"
205 exit 1
206 fi
207 fi
208 if [ $with_selenium -eq 1 ]; then
209 SELENIUM_JOB=`ps -elf | grep "selenium" | grep -v grep`
210 if [ $? -eq 0 ]; then
211 echo "WARNING: Selenium doesn't appear to be running. Please start a selenium server process."
212 with_selenium=0
213 fi
214 fi
215 if [ $only_selenium -eq 1 ]; then
216 export SKIP_UNITTESTS=1
217 fi
218 # Remove .pyc files. This is sanity checking because they can linger
219 # after old files are deleted.
220 find . -name "*.pyc" -exec rm -rf {} \;
221}
222
223function backup_environment {
224 if [ $backup_env -eq 1 ]; then
225 echo "Backing up environment \"$JOB_NAME\"..."
226 if [ ! -e ${venv} ]; then
227 echo "Environment not installed. Cannot back up."
228 return 0
229 fi
230 if [ -d /tmp/.horizon_environment/$JOB_NAME ]; then
231 mv /tmp/.horizon_environment/$JOB_NAME /tmp/.horizon_environment/$JOB_NAME.old
232 rm -rf /tmp/.horizon_environment/$JOB_NAME
233 fi
234 mkdir -p /tmp/.horizon_environment/$JOB_NAME
235 cp -r $venv /tmp/.horizon_environment/$JOB_NAME/
236 cp .environment_version /tmp/.horizon_environment/$JOB_NAME/
237 # Remove the backup now that we've completed successfully
238 rm -rf /tmp/.horizon_environment/$JOB_NAME.old
239 echo "Backup completed"
240 fi
241}
242
243function restore_environment {
244 if [ $restore_env -eq 1 ]; then
245 echo "Restoring environment from backup..."
246 if [ ! -d /tmp/.horizon_environment/$JOB_NAME ]; then
247 echo "No backup to restore from."
248 return 0
249 fi
250
251 cp -r /tmp/.horizon_environment/$JOB_NAME/.venv ./ || true
252 cp -r /tmp/.horizon_environment/$JOB_NAME/.environment_version ./ || true
253
254 echo "Environment restored successfully."
255 fi
256}
257
258function install_venv {
259 # Install with install_venv.py
260 export PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE-/tmp/.pip_download_cache}
261 export PIP_USE_MIRRORS=true
262 if [ $quiet -eq 1 ]; then
263 export PIP_NO_INPUT=true
264 fi
265 echo "Fetching new src packages..."
266 rm -rf $venv/src
267 python tools/install_venv.py
268 command_wrapper="$root/${with_venv}"
269 # Make sure it worked and record the environment version
270 sanity_check
271 chmod -R 754 $venv
272 echo $environment_version > .environment_version
273}
274
275function run_tests {
276 sanity_check
277
278 echo "Running Horizon application tests"
279 export NOSE_XUNIT_FILE=horizon/nosetests.xml
280 ${command_wrapper} coverage erase
281 ${command_wrapper} coverage run -p $root/manage.py test horizon --settings=horizon.tests.testsettings $testargs
282 # get results of the Horizon tests
283 HORIZON_RESULT=$?
284
285 echo "Running openstack_dashboard tests"
286 export NOSE_XUNIT_FILE=openstack_dashboard/nosetests.xml
287 if [ $with_selenium -eq 1 ]; then
288 ${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=horizon.tests.testsettings --with-selenium --with-cherrypyliveserver $testargs
289 else
290 ${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=horizon.tests.testsettings $testargs
291 fi
292 # get results of the openstack_dashboard tests
293 DASHBOARD_RESULT=$?
294
295 if [ $with_coverage -eq 1 ]; then
296 echo "Generating coverage reports"
297 ${command_wrapper} coverage combine
298 ${command_wrapper} coverage xml -i --omit='/usr*,setup.py,*egg*,.venv/*'
299 ${command_wrapper} coverage html -i --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
300 fi
301 # Remove the leftover coverage files from the -p flag earlier.
302 rm -f .coverage.*
303
304 if [ $(($HORIZON_RESULT || $DASHBOARD_RESULT)) -eq 0 ]; then
305 echo "Tests completed successfully."
306 else
307 echo "Tests failed."
308 fi
309 exit $(($HORIZON_RESULT || $DASHBOARD_RESULT))
310}
311
312function run_makemessages {
313 cd horizon
314 ${command_wrapper} $root/manage.py makemessages --all
315 HORIZON_RESULT=$?
316 cd ../openstack_dashboard
317 ${command_wrapper} $root/manage.py makemessages --all
318 DASHBOARD_RESULT=$?
319 cd ..
320 exit $(($HORIZON_RESULT || $DASHBOARD_RESULT))
321}
322
323
324# ---------PREPARE THE ENVIRONMENT------------ #
325
326# PROCESS ARGUMENTS, OVERRIDE DEFAULTS
327for arg in "$@"; do
328 process_option $arg
329done
330
331if [ $quiet -eq 1 ] && [ $never_venv -eq 0 ] && [ $always_venv -eq 0 ]
332then
333 always_venv=1
334fi
335
336# If destroy is set, just blow it away and exit.
337if [ $destroy -eq 1 ]; then
338 destroy_venv
339 exit 0
340fi
341
342# Ignore all of this if the -N flag was set
343if [ $never_venv -eq 0 ]; then
344
345 # Restore previous environment if desired
346 if [ $restore_env -eq 1 ]; then
347 restore_environment
348 fi
349
350 # Remove the virtual environment if --force used
351 if [ $force -eq 1 ]; then
352 destroy_venv
353 fi
354
355 # Then check if it's up-to-date
356 environment_check
357
358 # Create a backup of the up-to-date environment if desired
359 if [ $backup_env -eq 1 ]; then
360 backup_environment
361 fi
362fi
363
364# ---------EXERCISE THE CODE------------ #
365
366# Build the docs
367if [ $just_docs -eq 1 ]; then
368 run_sphinx
369 exit $?
370fi
371
372# Update translation files
373if [ $makemessages -eq 1 ]; then
374 run_makemessages
375 exit $?
376fi
377
378# PEP8
379if [ $just_pep8 -eq 1 ]; then
380 run_pep8
381 exit $?
382fi
383
384# Pylint
385if [ $just_pylint -eq 1 ]; then
386 run_pylint
387 exit $?
388fi
389
390# Tab checker
391if [ $just_tabs -eq 1 ]; then
392 tab_check
393 exit $?
394fi
395
396# Django development server
397if [ $runserver -eq 1 ]; then
398 run_server
399 exit $?
400fi
401
402# Full test suite
403run_tests || exit
4040
=== added directory '.pc/fix-dashboard-django-wsgi.patch'
=== removed directory '.pc/fix-dashboard-django-wsgi.patch'
=== added file '.pc/fix-dashboard-django-wsgi.patch/.timestamp'
=== added directory '.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard'
=== removed directory '.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard'
=== added directory '.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi'
=== removed directory '.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi'
=== added file '.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi'
--- .pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi 1970-01-01 00:00:00 +0000
+++ .pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi 2013-04-24 15:22:28 +0000
@@ -0,0 +1,15 @@
1import logging
2import os
3import sys
4import django.core.handlers.wsgi
5from django.conf import settings
6
7# Add this file path to sys.path in order to import settings
8sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))
9os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
10sys.stdout = sys.stderr
11
12DEBUG = False
13
14application = django.core.handlers.wsgi.WSGIHandler()
15
016
=== removed file '.pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi'
--- .pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi 2012-03-02 12:11:59 +0000
+++ .pc/fix-dashboard-django-wsgi.patch/openstack_dashboard/wsgi/django.wsgi 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
1import logging
2import os
3import sys
4import django.core.handlers.wsgi
5from django.conf import settings
6
7# Add this file path to sys.path in order to import settings
8sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))
9os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
10sys.stdout = sys.stderr
11
12DEBUG = False
13
14application = django.core.handlers.wsgi.WSGIHandler()
15
160
=== added directory '.pc/fix-dashboard-manage.patch'
=== removed directory '.pc/fix-dashboard-manage.patch'
=== added file '.pc/fix-dashboard-manage.patch/.timestamp'
=== added file '.pc/fix-dashboard-manage.patch/manage.py'
--- .pc/fix-dashboard-manage.patch/manage.py 1970-01-01 00:00:00 +0000
+++ .pc/fix-dashboard-manage.patch/manage.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,12 @@
1#!/usr/bin/env python
2
3import os
4import sys
5
6
7if __name__ == "__main__":
8 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openstack_dashboard.settings")
9
10 from django.core.management import execute_from_command_line
11
12 execute_from_command_line(sys.argv)
013
=== removed file '.pc/fix-dashboard-manage.patch/manage.py'
--- .pc/fix-dashboard-manage.patch/manage.py 2012-03-09 11:50:22 +0000
+++ .pc/fix-dashboard-manage.patch/manage.py 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1#!/usr/bin/env python
2
3import os
4import sys
5
6
7if __name__ == "__main__":
8 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openstack_dashboard.settings")
9
10 from django.core.management import execute_from_command_line
11
12 execute_from_command_line(sys.argv)
130
=== added directory '.pc/juju_panel-handle_catalog_exception.patch'
=== removed directory '.pc/juju_panel-handle_catalog_exception.patch'
=== added file '.pc/juju_panel-handle_catalog_exception.patch/.timestamp'
=== added directory '.pc/juju_panel-handle_catalog_exception.patch/horizon'
=== removed directory '.pc/juju_panel-handle_catalog_exception.patch/horizon'
=== added directory '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards'
=== removed directory '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards'
=== added directory '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings'
=== removed directory '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings'
=== added directory '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju'
=== removed directory '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju'
=== added file '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py'
--- .pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py 1970-01-01 00:00:00 +0000
+++ .pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,96 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Canonical Ltd.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18import logging
19import tempfile
20import zipfile
21from contextlib import closing
22
23from django import http, shortcuts
24from django.template.loader import render_to_string
25from django.utils.translation import ugettext_lazy as _
26
27from horizon import api
28from horizon import exceptions
29from horizon import forms
30
31import boto
32import uuid
33
34LOG = logging.getLogger(__name__)
35
36
37class DownloadJujuEnvironment(forms.SelfHandlingForm):
38 # This is heavily based off the ec2 credentials form
39 tenant = forms.ChoiceField(label=_("Select a Project"))
40 @classmethod
41 def _instantiate(cls, request, *args, **kwargs):
42 return cls(request, *args, **kwargs)
43
44 def __init__(self, request, *args, **kwargs):
45 super(DownloadJujuEnvironment, self).__init__(*args, **kwargs)
46 tenant_choices = []
47 try:
48 tenant_list = api.keystone.tenant_list(request)
49 except:
50 tenant_list = []
51 exceptions.handle(request, _("Unable to retrieve tenant list."))
52
53 for tenant in tenant_list:
54 if tenant.enabled:
55 tenant_choices.append((tenant.id, tenant.name))
56 if not tenant_choices:
57 self.fields['tenant'].choices = ('', 'No Available Tenants')
58 else:
59 self.fields['tenant'].choices = tenant_choices
60
61 def handle(self, request, data):
62 def find_or_create_access_keys(request, tenant_id):
63 keys = api.keystone.list_ec2_credentials(request, request.user.id)
64 if keys:
65 return keys[0]
66 else:
67 return api.keystone.create_ec2_credentials(request,
68 request.user.id,
69 tenant_id)
70 try:
71 api.keystone.token_create_scoped(request,
72 data.get('tenant'),
73 request.user.token)
74 keys = find_or_create_access_keys(request, data.get('tenant'))
75 tenant_id = data['tenant']
76 tenant_name = dict(self.fields['tenant'].choices)[tenant_id]
77 control_bucket = "juju-openstack-%s-%s" % (tenant_name, str(uuid.uuid4())[19:])
78 context = {'ec2_access_key': keys.access,
79 'ec2_secret_key': keys.secret,
80 'ec2_url': api.url_for(request, 'ec2'),
81 's3_url': api.url_for(request, 's3'),
82 'juju_admin_secret': uuid.uuid4().hex,
83 'control_bucket': control_bucket
84 }
85 except:
86 exceptions.handle(request,
87 _('Unable to fetch generate Juju environment config.'),
88 redirect=request.build_absolute_uri())
89
90 response = shortcuts.render(request,
91 'settings/juju/environments.yaml.template',
92 context,
93 content_type='text/plain')
94 response['Content-Disposition'] = 'attachment; filename=environments.yaml'
95 response['Content-Length'] = str(len(response.content))
96 return response
097
=== removed file '.pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py'
--- .pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py 2012-08-24 03:27:33 +0000
+++ .pc/juju_panel-handle_catalog_exception.patch/horizon/dashboards/settings/juju/forms.py 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Canonical Ltd.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18import logging
19import tempfile
20import zipfile
21from contextlib import closing
22
23from django import http, shortcuts
24from django.template.loader import render_to_string
25from django.utils.translation import ugettext_lazy as _
26
27from horizon import api
28from horizon import exceptions
29from horizon import forms
30
31import boto
32import uuid
33
34LOG = logging.getLogger(__name__)
35
36
37class DownloadJujuEnvironment(forms.SelfHandlingForm):
38 # This is heavily based off the ec2 credentials form
39 tenant = forms.ChoiceField(label=_("Select a Project"))
40 @classmethod
41 def _instantiate(cls, request, *args, **kwargs):
42 return cls(request, *args, **kwargs)
43
44 def __init__(self, request, *args, **kwargs):
45 super(DownloadJujuEnvironment, self).__init__(*args, **kwargs)
46 tenant_choices = []
47 try:
48 tenant_list = api.keystone.tenant_list(request)
49 except:
50 tenant_list = []
51 exceptions.handle(request, _("Unable to retrieve tenant list."))
52
53 for tenant in tenant_list:
54 if tenant.enabled:
55 tenant_choices.append((tenant.id, tenant.name))
56 if not tenant_choices:
57 self.fields['tenant'].choices = ('', 'No Available Tenants')
58 else:
59 self.fields['tenant'].choices = tenant_choices
60
61 def handle(self, request, data):
62 def find_or_create_access_keys(request, tenant_id):
63 keys = api.keystone.list_ec2_credentials(request, request.user.id)
64 if keys:
65 return keys[0]
66 else:
67 return api.keystone.create_ec2_credentials(request,
68 request.user.id,
69 tenant_id)
70 try:
71 api.keystone.token_create_scoped(request,
72 data.get('tenant'),
73 request.user.token)
74 keys = find_or_create_access_keys(request, data.get('tenant'))
75 tenant_id = data['tenant']
76 tenant_name = dict(self.fields['tenant'].choices)[tenant_id]
77 control_bucket = "juju-openstack-%s-%s" % (tenant_name, str(uuid.uuid4())[19:])
78 context = {'ec2_access_key': keys.access,
79 'ec2_secret_key': keys.secret,
80 'ec2_url': api.url_for(request, 'ec2'),
81 's3_url': api.url_for(request, 's3'),
82 'juju_admin_secret': uuid.uuid4().hex,
83 'control_bucket': control_bucket
84 }
85 except:
86 exceptions.handle(request,
87 _('Unable to fetch generate Juju environment config.'),
88 redirect=request.build_absolute_uri())
89
90 response = shortcuts.render(request,
91 'settings/juju/environments.yaml.template',
92 context,
93 content_type='text/plain')
94 response['Content-Disposition'] = 'attachment; filename=environments.yaml'
95 response['Content-Length'] = str(len(response.content))
96 return response
970
=== added directory '.pc/turn-off-debug.patch'
=== removed directory '.pc/turn-off-debug.patch'
=== added file '.pc/turn-off-debug.patch/.timestamp'
=== added directory '.pc/turn-off-debug.patch/openstack_dashboard'
=== removed directory '.pc/turn-off-debug.patch/openstack_dashboard'
=== added directory '.pc/turn-off-debug.patch/openstack_dashboard/local'
=== removed directory '.pc/turn-off-debug.patch/openstack_dashboard/local'
=== added file '.pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example'
--- .pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example 1970-01-01 00:00:00 +0000
+++ .pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example 2013-04-24 15:22:28 +0000
@@ -0,0 +1,123 @@
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5DEBUG = True
6TEMPLATE_DEBUG = DEBUG
7PROD = False
8USE_SSL = False
9
10# Ubuntu-specific: Enables an extra panel in the 'Settings' section
11# that easily generates a Juju environments.yaml for download,
12# preconfigured with endpoints and credentails required for bootstrap
13# and service deployment.
14ENABLE_JUJU_PANEL = True
15
16# Note: You should change this value
17SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
18
19# Specify a regular expression to validate user passwords.
20# HORIZON_CONFIG = {
21# "password_validator": {
22# "regex": '.*',
23# "help_text": _("Your password does not meet the requirements.")
24# }
25# }
26
27LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
28
29# We recommend you use memcached for development; otherwise after every reload
30# of the django development server, you will have to login again. To use
31# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
32CACHE_BACKEND = 'locmem://'
33
34# Send email to the console by default
35EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
36# Or send them to /dev/null
37#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
38
39# Configure these for your outgoing email host
40# EMAIL_HOST = 'smtp.my-company.com'
41# EMAIL_PORT = 25
42# EMAIL_HOST_USER = 'djangomail'
43# EMAIL_HOST_PASSWORD = 'top-secret!'
44
45# For multiple regions uncomment this configuration, and add (endpoint, title).
46# AVAILABLE_REGIONS = [
47# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
48# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
49# ]
50
51OPENSTACK_HOST = "127.0.0.1"
52OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
53OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
54
55# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
56# capabilities of the auth backend for Keystone.
57# If Keystone has been configured to use LDAP as the auth backend then set
58# can_edit_user to False and name to 'ldap'.
59#
60# TODO(tres): Remove these once Keystone has an API to identify auth backend.
61OPENSTACK_KEYSTONE_BACKEND = {
62 'name': 'native',
63 'can_edit_user': True
64}
65
66# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
67# in the Keystone service catalog. Use this setting when Horizon is running
68# external to the OpenStack environment. The default is 'internalURL'.
69#OPENSTACK_ENDPOINT_TYPE = "publicURL"
70
71# The number of Swift containers and objects to display on a single page before
72# providing a paging element (a "more" link) to paginate results.
73API_RESULT_LIMIT = 1000
74
75# If you have external monitoring links, eg:
76# EXTERNAL_MONITORING = [
77# ['Nagios','http://foo.com'],
78# ['Ganglia','http://bar.com'],
79# ]
80
81LOGGING = {
82 'version': 1,
83 # When set to True this will disable all logging except
84 # for loggers specified in this configuration dictionary. Note that
85 # if nothing is specified here and disable_existing_loggers is True,
86 # django.db.backends will still log unless it is disabled explicitly.
87 'disable_existing_loggers': False,
88 'handlers': {
89 'null': {
90 'level': 'DEBUG',
91 'class': 'django.utils.log.NullHandler',
92 },
93 'console': {
94 # Set the level to "DEBUG" for verbose output logging.
95 'level': 'INFO',
96 'class': 'logging.StreamHandler',
97 },
98 },
99 'loggers': {
100 # Logging from django.db.backends is VERY verbose, send to null
101 # by default.
102 'django.db.backends': {
103 'handlers': ['null'],
104 'propagate': False,
105 },
106 'horizon': {
107 'handlers': ['console'],
108 'propagate': False,
109 },
110 'novaclient': {
111 'handlers': ['console'],
112 'propagate': False,
113 },
114 'keystoneclient': {
115 'handlers': ['console'],
116 'propagate': False,
117 },
118 'nose.plugins.manager': {
119 'handlers': ['console'],
120 'propagate': False,
121 }
122 }
123}
0124
=== removed file '.pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example'
--- .pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example 2012-04-23 10:04:39 +0000
+++ .pc/turn-off-debug.patch/openstack_dashboard/local/local_settings.py.example 1970-01-01 00:00:00 +0000
@@ -1,123 +0,0 @@
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5DEBUG = True
6TEMPLATE_DEBUG = DEBUG
7PROD = False
8USE_SSL = False
9
10# Ubuntu-specific: Enables an extra panel in the 'Settings' section
11# that easily generates a Juju environments.yaml for download,
12# preconfigured with endpoints and credentails required for bootstrap
13# and service deployment.
14ENABLE_JUJU_PANEL = True
15
16# Note: You should change this value
17SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
18
19# Specify a regular expression to validate user passwords.
20# HORIZON_CONFIG = {
21# "password_validator": {
22# "regex": '.*',
23# "help_text": _("Your password does not meet the requirements.")
24# }
25# }
26
27LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
28
29# We recommend you use memcached for development; otherwise after every reload
30# of the django development server, you will have to login again. To use
31# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
32CACHE_BACKEND = 'locmem://'
33
34# Send email to the console by default
35EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
36# Or send them to /dev/null
37#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
38
39# Configure these for your outgoing email host
40# EMAIL_HOST = 'smtp.my-company.com'
41# EMAIL_PORT = 25
42# EMAIL_HOST_USER = 'djangomail'
43# EMAIL_HOST_PASSWORD = 'top-secret!'
44
45# For multiple regions uncomment this configuration, and add (endpoint, title).
46# AVAILABLE_REGIONS = [
47# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
48# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
49# ]
50
51OPENSTACK_HOST = "127.0.0.1"
52OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
53OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
54
55# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
56# capabilities of the auth backend for Keystone.
57# If Keystone has been configured to use LDAP as the auth backend then set
58# can_edit_user to False and name to 'ldap'.
59#
60# TODO(tres): Remove these once Keystone has an API to identify auth backend.
61OPENSTACK_KEYSTONE_BACKEND = {
62 'name': 'native',
63 'can_edit_user': True
64}
65
66# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
67# in the Keystone service catalog. Use this setting when Horizon is running
68# external to the OpenStack environment. The default is 'internalURL'.
69#OPENSTACK_ENDPOINT_TYPE = "publicURL"
70
71# The number of Swift containers and objects to display on a single page before
72# providing a paging element (a "more" link) to paginate results.
73API_RESULT_LIMIT = 1000
74
75# If you have external monitoring links, eg:
76# EXTERNAL_MONITORING = [
77# ['Nagios','http://foo.com'],
78# ['Ganglia','http://bar.com'],
79# ]
80
81LOGGING = {
82 'version': 1,
83 # When set to True this will disable all logging except
84 # for loggers specified in this configuration dictionary. Note that
85 # if nothing is specified here and disable_existing_loggers is True,
86 # django.db.backends will still log unless it is disabled explicitly.
87 'disable_existing_loggers': False,
88 'handlers': {
89 'null': {
90 'level': 'DEBUG',
91 'class': 'django.utils.log.NullHandler',
92 },
93 'console': {
94 # Set the level to "DEBUG" for verbose output logging.
95 'level': 'INFO',
96 'class': 'logging.StreamHandler',
97 },
98 },
99 'loggers': {
100 # Logging from django.db.backends is VERY verbose, send to null
101 # by default.
102 'django.db.backends': {
103 'handlers': ['null'],
104 'propagate': False,
105 },
106 'horizon': {
107 'handlers': ['console'],
108 'propagate': False,
109 },
110 'novaclient': {
111 'handlers': ['console'],
112 'propagate': False,
113 },
114 'keystoneclient': {
115 'handlers': ['console'],
116 'propagate': False,
117 },
118 'nose.plugins.manager': {
119 'handlers': ['console'],
120 'propagate': False,
121 }
122 }
123}
1240
=== added directory '.pc/use-memcache.patch'
=== removed directory '.pc/use-memcache.patch'
=== added file '.pc/use-memcache.patch/.timestamp'
=== added directory '.pc/use-memcache.patch/openstack_dashboard'
=== removed directory '.pc/use-memcache.patch/openstack_dashboard'
=== added directory '.pc/use-memcache.patch/openstack_dashboard/local'
=== removed directory '.pc/use-memcache.patch/openstack_dashboard/local'
=== added file '.pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example'
--- .pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example 1970-01-01 00:00:00 +0000
+++ .pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example 2013-04-24 15:22:28 +0000
@@ -0,0 +1,123 @@
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5DEBUG = False
6TEMPLATE_DEBUG = DEBUG
7PROD = False
8USE_SSL = False
9
10# Ubuntu-specific: Enables an extra panel in the 'Settings' section
11# that easily generates a Juju environments.yaml for download,
12# preconfigured with endpoints and credentails required for bootstrap
13# and service deployment.
14ENABLE_JUJU_PANEL = True
15
16# Note: You should change this value
17SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
18
19# Specify a regular expression to validate user passwords.
20# HORIZON_CONFIG = {
21# "password_validator": {
22# "regex": '.*',
23# "help_text": _("Your password does not meet the requirements.")
24# }
25# }
26
27LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
28
29# We recommend you use memcached for development; otherwise after every reload
30# of the django development server, you will have to login again. To use
31# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
32CACHE_BACKEND = 'locmem://'
33
34# Send email to the console by default
35EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
36# Or send them to /dev/null
37#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
38
39# Configure these for your outgoing email host
40# EMAIL_HOST = 'smtp.my-company.com'
41# EMAIL_PORT = 25
42# EMAIL_HOST_USER = 'djangomail'
43# EMAIL_HOST_PASSWORD = 'top-secret!'
44
45# For multiple regions uncomment this configuration, and add (endpoint, title).
46# AVAILABLE_REGIONS = [
47# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
48# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
49# ]
50
51OPENSTACK_HOST = "127.0.0.1"
52OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
53OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
54
55# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
56# capabilities of the auth backend for Keystone.
57# If Keystone has been configured to use LDAP as the auth backend then set
58# can_edit_user to False and name to 'ldap'.
59#
60# TODO(tres): Remove these once Keystone has an API to identify auth backend.
61OPENSTACK_KEYSTONE_BACKEND = {
62 'name': 'native',
63 'can_edit_user': True
64}
65
66# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
67# in the Keystone service catalog. Use this setting when Horizon is running
68# external to the OpenStack environment. The default is 'internalURL'.
69#OPENSTACK_ENDPOINT_TYPE = "publicURL"
70
71# The number of Swift containers and objects to display on a single page before
72# providing a paging element (a "more" link) to paginate results.
73API_RESULT_LIMIT = 1000
74
75# If you have external monitoring links, eg:
76# EXTERNAL_MONITORING = [
77# ['Nagios','http://foo.com'],
78# ['Ganglia','http://bar.com'],
79# ]
80
81LOGGING = {
82 'version': 1,
83 # When set to True this will disable all logging except
84 # for loggers specified in this configuration dictionary. Note that
85 # if nothing is specified here and disable_existing_loggers is True,
86 # django.db.backends will still log unless it is disabled explicitly.
87 'disable_existing_loggers': False,
88 'handlers': {
89 'null': {
90 'level': 'DEBUG',
91 'class': 'django.utils.log.NullHandler',
92 },
93 'console': {
94 # Set the level to "DEBUG" for verbose output logging.
95 'level': 'INFO',
96 'class': 'logging.StreamHandler',
97 },
98 },
99 'loggers': {
100 # Logging from django.db.backends is VERY verbose, send to null
101 # by default.
102 'django.db.backends': {
103 'handlers': ['null'],
104 'propagate': False,
105 },
106 'horizon': {
107 'handlers': ['console'],
108 'propagate': False,
109 },
110 'novaclient': {
111 'handlers': ['console'],
112 'propagate': False,
113 },
114 'keystoneclient': {
115 'handlers': ['console'],
116 'propagate': False,
117 },
118 'nose.plugins.manager': {
119 'handlers': ['console'],
120 'propagate': False,
121 }
122 }
123}
0124
=== removed file '.pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example'
--- .pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example 2012-04-25 10:55:18 +0000
+++ .pc/use-memcache.patch/openstack_dashboard/local/local_settings.py.example 1970-01-01 00:00:00 +0000
@@ -1,123 +0,0 @@
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5DEBUG = False
6TEMPLATE_DEBUG = DEBUG
7PROD = False
8USE_SSL = False
9
10# Ubuntu-specific: Enables an extra panel in the 'Settings' section
11# that easily generates a Juju environments.yaml for download,
12# preconfigured with endpoints and credentails required for bootstrap
13# and service deployment.
14ENABLE_JUJU_PANEL = True
15
16# Note: You should change this value
17SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
18
19# Specify a regular expression to validate user passwords.
20# HORIZON_CONFIG = {
21# "password_validator": {
22# "regex": '.*',
23# "help_text": _("Your password does not meet the requirements.")
24# }
25# }
26
27LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
28
29# We recommend you use memcached for development; otherwise after every reload
30# of the django development server, you will have to login again. To use
31# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
32CACHE_BACKEND = 'locmem://'
33
34# Send email to the console by default
35EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
36# Or send them to /dev/null
37#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
38
39# Configure these for your outgoing email host
40# EMAIL_HOST = 'smtp.my-company.com'
41# EMAIL_PORT = 25
42# EMAIL_HOST_USER = 'djangomail'
43# EMAIL_HOST_PASSWORD = 'top-secret!'
44
45# For multiple regions uncomment this configuration, and add (endpoint, title).
46# AVAILABLE_REGIONS = [
47# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
48# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
49# ]
50
51OPENSTACK_HOST = "127.0.0.1"
52OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
53OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
54
55# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
56# capabilities of the auth backend for Keystone.
57# If Keystone has been configured to use LDAP as the auth backend then set
58# can_edit_user to False and name to 'ldap'.
59#
60# TODO(tres): Remove these once Keystone has an API to identify auth backend.
61OPENSTACK_KEYSTONE_BACKEND = {
62 'name': 'native',
63 'can_edit_user': True
64}
65
66# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
67# in the Keystone service catalog. Use this setting when Horizon is running
68# external to the OpenStack environment. The default is 'internalURL'.
69#OPENSTACK_ENDPOINT_TYPE = "publicURL"
70
71# The number of Swift containers and objects to display on a single page before
72# providing a paging element (a "more" link) to paginate results.
73API_RESULT_LIMIT = 1000
74
75# If you have external monitoring links, eg:
76# EXTERNAL_MONITORING = [
77# ['Nagios','http://foo.com'],
78# ['Ganglia','http://bar.com'],
79# ]
80
81LOGGING = {
82 'version': 1,
83 # When set to True this will disable all logging except
84 # for loggers specified in this configuration dictionary. Note that
85 # if nothing is specified here and disable_existing_loggers is True,
86 # django.db.backends will still log unless it is disabled explicitly.
87 'disable_existing_loggers': False,
88 'handlers': {
89 'null': {
90 'level': 'DEBUG',
91 'class': 'django.utils.log.NullHandler',
92 },
93 'console': {
94 # Set the level to "DEBUG" for verbose output logging.
95 'level': 'INFO',
96 'class': 'logging.StreamHandler',
97 },
98 },
99 'loggers': {
100 # Logging from django.db.backends is VERY verbose, send to null
101 # by default.
102 'django.db.backends': {
103 'handlers': ['null'],
104 'propagate': False,
105 },
106 'horizon': {
107 'handlers': ['console'],
108 'propagate': False,
109 },
110 'novaclient': {
111 'handlers': ['console'],
112 'propagate': False,
113 },
114 'keystoneclient': {
115 'handlers': ['console'],
116 'propagate': False,
117 },
118 'nose.plugins.manager': {
119 'handlers': ['console'],
120 'propagate': False,
121 }
122 }
123}
1240
=== removed file '.pylintrc'
--- .pylintrc 2012-08-24 03:27:33 +0000
+++ .pylintrc 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1# The format of this file isn't really documented; just use --generate-rcfile
2[MASTER]
3# Add <file or directory> to the black list. It should be a base name, not a
4# path. You may set this option multiple times.
5ignore=test
6
7[Messages Control]
8# NOTE(justinsb): We might want to have a 2nd strict pylintrc in future
9# C0111: Don't require docstrings on every method
10# W0511: TODOs in code comments are fine.
11# W0142: *args and **kwargs are fine.
12# W0622: Redefining id is fine.
13disable=C0111,W0511,W0142,W0622
14
15[Basic]
16# Variable names can be 1 to 31 characters long, with lowercase and underscores
17variable-rgx=[a-z_][a-z0-9_]{0,30}$
18
19# Argument names can be 2 to 31 characters long, with lowercase and underscores
20argument-rgx=[a-z_][a-z0-9_]{1,30}$
21
22# Method names should be at least 3 characters long
23# and be lowecased with underscores
24method-rgx=([a-z_][a-z0-9_]{2,50}|setUp|tearDown)$
25
26# Module names matching keystone-* are ok (files in bin/)
27module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(keystone-[a-z0-9_-]+))$
28
29# Don't require docstrings on tests.
30no-docstring-rgx=((__.*__)|([tT]est.*)|setUp|tearDown)$
31
32[Design]
33max-public-methods=100
34min-public-methods=0
35max-args=6
36
37[Variables]
38
39# List of additional names supposed to be defined in builtins. Remember that
40# you should avoid to define new builtins when possible.
41# _ is used by our localization
42additional-builtins=_
430
=== modified file 'AUTHORS'
--- AUTHORS 2012-08-24 03:27:33 +0000
+++ AUTHORS 2013-04-24 15:22:28 +0000
@@ -3,6 +3,7 @@
3Andy Chong <andycjw@gmail.com>3Andy Chong <andycjw@gmail.com>
4Anthony Young <sleepsonthefloor@gmail.com>4Anthony Young <sleepsonthefloor@gmail.com>
5Arvind Somya <asomya@cisco.com>5Arvind Somya <asomya@cisco.com>
6Brian Waldon <bcwaldon@gmail.com>
6Carlo Truijllo <truijllo@crs4.it>7Carlo Truijllo <truijllo@crs4.it>
7Chuck Short <chuck.short@canonical.com>8Chuck Short <chuck.short@canonical.com>
8Cole Robinson <crobinso@redhat.com>9Cole Robinson <crobinso@redhat.com>
@@ -47,6 +48,7 @@
47Todd Willey <todd@ansolabs.com>48Todd Willey <todd@ansolabs.com>
48Tomasz 'Zen' Napierala <tomasz@napierala.org>49Tomasz 'Zen' Napierala <tomasz@napierala.org>
49Tres Henry <tres@treshenry.net>50Tres Henry <tres@treshenry.net>
51Vincent Untz <vuntz@suse.com>
50Vishvananda Ishaya <vishvananda@gmail.com>52Vishvananda Ishaya <vishvananda@gmail.com>
51Yuriy Taraday <yorik.sar@gmail.com>53Yuriy Taraday <yorik.sar@gmail.com>
52ZhongYue Luo <lzyeval@gmail.com>54ZhongYue Luo <lzyeval@gmail.com>
5355
=== added file 'PKG-INFO'
--- PKG-INFO 1970-01-01 00:00:00 +0000
+++ PKG-INFO 2013-04-24 15:22:28 +0000
@@ -0,0 +1,126 @@
1Metadata-Version: 1.1
2Name: horizon
3Version: 2012.1.4
4Summary: The OpenStack Dashboard.
5Home-page: https://github.com/openstack/horizon/
6Author: OpenStack
7Author-email: horizon@lists.launchpad.net
8License: Apache 2.0
9Description: =============================
10 Horizon (OpenStack Dashboard)
11 =============================
12
13 Horizon is a Django-based project aimed at providing a complete OpenStack
14 Dashboard along with an extensible framework for building new dashboards
15 from reusable components. The ``openstack_dashboard`` module is a reference
16 implementation of a Django site that uses the ``horizon`` app to provide
17 web-based interactions with the various OpenStack projects.
18
19 For release management:
20
21 * https://launchpad.net/horizon
22
23 For blueprints and feature specifications:
24
25 * https://blueprints.launchpad.net/horizon
26
27 For issue tracking:
28
29 * https://bugs.launchpad.net/horizon
30
31 Getting Started
32 ===============
33
34 For local development, first create a virtualenv for the project.
35 In the ``tools`` directory there is a script to create one for you:
36
37 $ python tools/install_venv.py
38
39 Alternatively, the ``run_tests.sh`` script will also install the environment
40 for you and then run the full test suite to verify everything is installed
41 and functioning correctly.
42
43 Now that the virtualenv is created, you need to configure your local
44 environment. To do this, create a ``local_settings.py`` file in the
45 ``openstack_dashboard/local/`` directory. There is a
46 ``local_settings.py.example`` file there that may be used as a template.
47
48 If all is well you should able to run the development server locally:
49
50 $ tools/with_venv.sh manage.py runserver
51
52 or, as a shortcut::
53
54 $ ./run_tests.sh --runserver
55
56
57 Settings Up OpenStack
58 =====================
59
60 The recommended tool for installing and configuring the core OpenStack
61 components is `Devstack`_. Refer to their documentation for getting
62 Nova, Keystone, Glance, etc. up and running.
63
64 .. _Devstack: http://devstack.org/
65
66 .. note::
67
68 The minimum required set of OpenStack services running includes the
69 following:
70
71 * Nova (compute, api, scheduler, network, *and* volume services)
72 * Glance
73 * Keystone
74
75 Optional support is provided for Swift.
76
77
78 Development
79 ===========
80
81 For development, start with the getting started instructions above.
82 Once you have a working virtualenv and all the necessary packages, read on.
83
84 If dependencies are added to either ``horizon`` or ``openstack-dashboard``,
85 they should be added to ``tools/pip-requires``.
86
87 The ``run_tests.sh`` script invokes tests and analyses on both of these
88 components in its process, and it is what Jenkins uses to verify the
89 stability of the project. If run before an environment is set up, it will
90 ask if you wish to install one.
91
92 To run the unit tests::
93
94 $ ./run_tests.sh
95
96 Building Contributor Documentation
97 ==================================
98
99 This documentation is written by contributors, for contributors.
100
101 The source is maintained in the ``docs/source`` folder using
102 `reStructuredText`_ and built by `Sphinx`_
103
104 .. _reStructuredText: http://docutils.sourceforge.net/rst.html
105 .. _Sphinx: http://sphinx.pocoo.org/
106
107 * Building Automatically::
108
109 $ ./run_tests.sh --docs
110
111 * Building Manually::
112
113 $ export DJANGO_SETTINGS_MODULE=local.local_settings
114 $ python doc/generate_autodoc_index.py
115 $ sphinx-build -b html doc/source build/sphinx/html
116
117 Results are in the `build/sphinx/html` directory
118
119Platform: UNKNOWN
120Classifier: Development Status :: 4 - Beta
121Classifier: Framework :: Django
122Classifier: Intended Audience :: Developers
123Classifier: License :: OSI Approved :: Apache Software License
124Classifier: Operating System :: OS Independent
125Classifier: Programming Language :: Python
126Classifier: Topic :: Internet :: WWW/HTTP
0127
=== modified file 'debian/changelog'
--- debian/changelog 2012-08-30 17:15:04 +0000
+++ debian/changelog 2013-04-24 15:22:28 +0000
@@ -1,3 +1,21 @@
1horizon (2012.1.3+stable-20130423-5ce39422-0ubuntu1) precise-proposed; urgency=low
2
3 * Resynchronize with stable/essex (LP: #1089488)
4 - [7e651d7] stable/essex horizon installs unusable version of glance
5 (LP: #1057125)
6 - [35eada8] open redirect / phishing attack via "next" parameter
7 (LP: #1039077)
8 - [8889311] TypeError when trying to delete an unnamed volume via dashboard
9 (LP: #1031291)
10 - [f862d9e] Wrong 'Download CSV Summary' link (LP: #1020555)
11 - [9b22d68] When adding ICMP rule, the type/code is being validated as
12 from/to ports (LP: #997669)
13 - [52bbba1] Added --only-selenium option in run_tests.sh
14 * Dropped patches, superseeded by new snapshot:
15 - debian/patches/CVE-2012-3540.patch [35eada8]
16
17 -- Yolanda <yolanda.robla@canonical.com> Wed, 24 Apr 2013 15:46:28 +0200
18
1horizon (2012.1.3+stable~20120815-691dd2-0ubuntu1.1) precise-security; urgency=low19horizon (2012.1.3+stable~20120815-691dd2-0ubuntu1.1) precise-security; urgency=low
220
3 * SECURITY UPDATE: open redirect / phishing attack via "next"21 * SECURITY UPDATE: open redirect / phishing attack via "next"
422
=== removed file 'debian/patches/CVE-2012-3540.patch'
--- debian/patches/CVE-2012-3540.patch 2012-08-30 17:15:04 +0000
+++ debian/patches/CVE-2012-3540.patch 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1Origin: https://github.com/openstack/horizon/commit/35eada8a27323c0f83c400177797927aba6bc99b
2Subject: Disallow login redirects to anywhere other than the same origin.
3Bug: https://bugs.launchpad.net/horizon/+bug/1039077
4
5CVE-2012-3540
6
7diff --git a/horizon/views/auth_forms.py b/horizon/views/auth_forms.py
8index 2ebecfc..abf0880 100644
9--- a/horizon/views/auth_forms.py
10+++ b/horizon/views/auth_forms.py
11@@ -28,6 +28,7 @@
12 from django.conf import settings
13 from django.contrib import messages
14 from django.contrib.auth import REDIRECT_FIELD_NAME
15+from django.utils.http import same_origin
16 from django.utils.translation import ugettext as _
17 from keystoneclient import exceptions as keystone_exceptions
18
19@@ -94,7 +95,13 @@ def handle(self, request, data):
20 request.session['region_endpoint'] = endpoint
21 request.session['region_name'] = region_name
22
23- redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, "")
24+ redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, None)
25+ # Make sure the requested redirect matches the protocol,
26+ # domain, and port of this request
27+ if redirect_to and not same_origin(
28+ request.build_absolute_uri(redirect_to),
29+ request.build_absolute_uri()):
30+ redirect_to = None
31
32 if data.get('tenant', None):
33 try:
340
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-08-30 17:15:04 +0000
+++ debian/patches/series 2013-04-24 15:22:28 +0000
@@ -6,4 +6,3 @@
6allow_alternate_css.patch6allow_alternate_css.patch
7use-memcache.patch7use-memcache.patch
8juju_panel-handle_catalog_exception.patch8juju_panel-handle_catalog_exception.patch
9CVE-2012-3540.patch
109
=== removed file 'docs/source/_static/.gitignore'
=== added directory 'horizon.egg-info'
=== added file 'horizon.egg-info/PKG-INFO'
--- horizon.egg-info/PKG-INFO 1970-01-01 00:00:00 +0000
+++ horizon.egg-info/PKG-INFO 2013-04-24 15:22:28 +0000
@@ -0,0 +1,126 @@
1Metadata-Version: 1.1
2Name: horizon
3Version: 2012.1.4
4Summary: The OpenStack Dashboard.
5Home-page: https://github.com/openstack/horizon/
6Author: OpenStack
7Author-email: horizon@lists.launchpad.net
8License: Apache 2.0
9Description: =============================
10 Horizon (OpenStack Dashboard)
11 =============================
12
13 Horizon is a Django-based project aimed at providing a complete OpenStack
14 Dashboard along with an extensible framework for building new dashboards
15 from reusable components. The ``openstack_dashboard`` module is a reference
16 implementation of a Django site that uses the ``horizon`` app to provide
17 web-based interactions with the various OpenStack projects.
18
19 For release management:
20
21 * https://launchpad.net/horizon
22
23 For blueprints and feature specifications:
24
25 * https://blueprints.launchpad.net/horizon
26
27 For issue tracking:
28
29 * https://bugs.launchpad.net/horizon
30
31 Getting Started
32 ===============
33
34 For local development, first create a virtualenv for the project.
35 In the ``tools`` directory there is a script to create one for you:
36
37 $ python tools/install_venv.py
38
39 Alternatively, the ``run_tests.sh`` script will also install the environment
40 for you and then run the full test suite to verify everything is installed
41 and functioning correctly.
42
43 Now that the virtualenv is created, you need to configure your local
44 environment. To do this, create a ``local_settings.py`` file in the
45 ``openstack_dashboard/local/`` directory. There is a
46 ``local_settings.py.example`` file there that may be used as a template.
47
48 If all is well you should able to run the development server locally:
49
50 $ tools/with_venv.sh manage.py runserver
51
52 or, as a shortcut::
53
54 $ ./run_tests.sh --runserver
55
56
57 Settings Up OpenStack
58 =====================
59
60 The recommended tool for installing and configuring the core OpenStack
61 components is `Devstack`_. Refer to their documentation for getting
62 Nova, Keystone, Glance, etc. up and running.
63
64 .. _Devstack: http://devstack.org/
65
66 .. note::
67
68 The minimum required set of OpenStack services running includes the
69 following:
70
71 * Nova (compute, api, scheduler, network, *and* volume services)
72 * Glance
73 * Keystone
74
75 Optional support is provided for Swift.
76
77
78 Development
79 ===========
80
81 For development, start with the getting started instructions above.
82 Once you have a working virtualenv and all the necessary packages, read on.
83
84 If dependencies are added to either ``horizon`` or ``openstack-dashboard``,
85 they should be added to ``tools/pip-requires``.
86
87 The ``run_tests.sh`` script invokes tests and analyses on both of these
88 components in its process, and it is what Jenkins uses to verify the
89 stability of the project. If run before an environment is set up, it will
90 ask if you wish to install one.
91
92 To run the unit tests::
93
94 $ ./run_tests.sh
95
96 Building Contributor Documentation
97 ==================================
98
99 This documentation is written by contributors, for contributors.
100
101 The source is maintained in the ``docs/source`` folder using
102 `reStructuredText`_ and built by `Sphinx`_
103
104 .. _reStructuredText: http://docutils.sourceforge.net/rst.html
105 .. _Sphinx: http://sphinx.pocoo.org/
106
107 * Building Automatically::
108
109 $ ./run_tests.sh --docs
110
111 * Building Manually::
112
113 $ export DJANGO_SETTINGS_MODULE=local.local_settings
114 $ python doc/generate_autodoc_index.py
115 $ sphinx-build -b html doc/source build/sphinx/html
116
117 Results are in the `build/sphinx/html` directory
118
119Platform: UNKNOWN
120Classifier: Development Status :: 4 - Beta
121Classifier: Framework :: Django
122Classifier: Intended Audience :: Developers
123Classifier: License :: OSI Approved :: Apache Software License
124Classifier: Operating System :: OS Independent
125Classifier: Programming Language :: Python
126Classifier: Topic :: Internet :: WWW/HTTP
0127
=== added file 'horizon.egg-info/SOURCES.txt'
--- horizon.egg-info/SOURCES.txt 1970-01-01 00:00:00 +0000
+++ horizon.egg-info/SOURCES.txt 2013-04-24 15:22:28 +0000
@@ -0,0 +1,478 @@
1AUTHORS
2LICENSE
3MANIFEST.in
4Makefile
5README.rst
6manage.py
7run_tests.sh
8setup.py
9docs/Makefile
10docs/source/conf.py
11docs/source/contributing.rst
12docs/source/faq.rst
13docs/source/glossary.rst
14docs/source/index.rst
15docs/source/intro.rst
16docs/source/quickstart.rst
17docs/source/testing.rst
18docs/source/_static/basic.css
19docs/source/_static/default.css
20docs/source/_static/header-line.gif
21docs/source/_static/header_bg.jpg
22docs/source/_static/jquery.tweet.js
23docs/source/_static/openstack_logo.png
24docs/source/_static/tweaks.css
25docs/source/_templates/.placeholder
26docs/source/_theme/layout.html
27docs/source/_theme/nature.css_t
28docs/source/_theme/theme.conf
29docs/source/ref/context_processors.rst
30docs/source/ref/decorators.rst
31docs/source/ref/exceptions.rst
32docs/source/ref/forms.rst
33docs/source/ref/horizon.rst
34docs/source/ref/middleware.rst
35docs/source/ref/run_tests.rst
36docs/source/ref/tables.rst
37docs/source/ref/tabs.rst
38docs/source/ref/test.rst
39docs/source/ref/users.rst
40docs/source/ref/views.rst
41docs/source/topics/customizing.rst
42docs/source/topics/deployment.rst
43docs/source/topics/tables.rst
44docs/source/topics/testing.rst
45horizon/__init__.py
46horizon/base.py
47horizon/context_processors.py
48horizon/decorators.py
49horizon/exceptions.py
50horizon/middleware.py
51horizon/models.py
52horizon/site_urls.py
53horizon/test.py
54horizon/time.py
55horizon/users.py
56horizon/version.py
57horizon.egg-info/PKG-INFO
58horizon.egg-info/SOURCES.txt
59horizon.egg-info/dependency_links.txt
60horizon.egg-info/not-zip-safe
61horizon.egg-info/requires.txt
62horizon.egg-info/top_level.txt
63horizon/api/__init__.py
64horizon/api/base.py
65horizon/api/glance.py
66horizon/api/keystone.py
67horizon/api/nova.py
68horizon/api/swift.py
69horizon/dashboards/__init__.py
70horizon/dashboards/nova/__init__.py
71horizon/dashboards/nova/dashboard.py
72horizon/dashboards/nova/models.py
73horizon/dashboards/nova/access_and_security/__init__.py
74horizon/dashboards/nova/access_and_security/panel.py
75horizon/dashboards/nova/access_and_security/tests.py
76horizon/dashboards/nova/access_and_security/urls.py
77horizon/dashboards/nova/access_and_security/views.py
78horizon/dashboards/nova/access_and_security/floating_ips/__init__.py
79horizon/dashboards/nova/access_and_security/floating_ips/forms.py
80horizon/dashboards/nova/access_and_security/floating_ips/tables.py
81horizon/dashboards/nova/access_and_security/floating_ips/tests.py
82horizon/dashboards/nova/access_and_security/floating_ips/urls.py
83horizon/dashboards/nova/access_and_security/floating_ips/views.py
84horizon/dashboards/nova/access_and_security/keypairs/__init__.py
85horizon/dashboards/nova/access_and_security/keypairs/forms.py
86horizon/dashboards/nova/access_and_security/keypairs/tables.py
87horizon/dashboards/nova/access_and_security/keypairs/tests.py
88horizon/dashboards/nova/access_and_security/keypairs/urls.py
89horizon/dashboards/nova/access_and_security/keypairs/views.py
90horizon/dashboards/nova/access_and_security/security_groups/__init__.py
91horizon/dashboards/nova/access_and_security/security_groups/forms.py
92horizon/dashboards/nova/access_and_security/security_groups/tables.py
93horizon/dashboards/nova/access_and_security/security_groups/tests.py
94horizon/dashboards/nova/access_and_security/security_groups/urls.py
95horizon/dashboards/nova/access_and_security/security_groups/views.py
96horizon/dashboards/nova/containers/__init__.py
97horizon/dashboards/nova/containers/forms.py
98horizon/dashboards/nova/containers/panel.py
99horizon/dashboards/nova/containers/tables.py
100horizon/dashboards/nova/containers/tests.py
101horizon/dashboards/nova/containers/urls.py
102horizon/dashboards/nova/containers/views.py
103horizon/dashboards/nova/images_and_snapshots/__init__.py
104horizon/dashboards/nova/images_and_snapshots/panel.py
105horizon/dashboards/nova/images_and_snapshots/tests.py
106horizon/dashboards/nova/images_and_snapshots/urls.py
107horizon/dashboards/nova/images_and_snapshots/views.py
108horizon/dashboards/nova/images_and_snapshots/images/__init__.py
109horizon/dashboards/nova/images_and_snapshots/images/forms.py
110horizon/dashboards/nova/images_and_snapshots/images/panel.py
111horizon/dashboards/nova/images_and_snapshots/images/tables.py
112horizon/dashboards/nova/images_and_snapshots/images/tabs.py
113horizon/dashboards/nova/images_and_snapshots/images/tests.py
114horizon/dashboards/nova/images_and_snapshots/images/urls.py
115horizon/dashboards/nova/images_and_snapshots/images/views.py
116horizon/dashboards/nova/images_and_snapshots/snapshots/__init__.py
117horizon/dashboards/nova/images_and_snapshots/snapshots/forms.py
118horizon/dashboards/nova/images_and_snapshots/snapshots/panel.py
119horizon/dashboards/nova/images_and_snapshots/snapshots/tables.py
120horizon/dashboards/nova/images_and_snapshots/snapshots/tests.py
121horizon/dashboards/nova/images_and_snapshots/snapshots/urls.py
122horizon/dashboards/nova/images_and_snapshots/snapshots/views.py
123horizon/dashboards/nova/images_and_snapshots/volume_snapshots/__init__.py
124horizon/dashboards/nova/images_and_snapshots/volume_snapshots/panel.py
125horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tables.py
126horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tests.py
127horizon/dashboards/nova/instances_and_volumes/__init__.py
128horizon/dashboards/nova/instances_and_volumes/panel.py
129horizon/dashboards/nova/instances_and_volumes/tests.py
130horizon/dashboards/nova/instances_and_volumes/urls.py
131horizon/dashboards/nova/instances_and_volumes/views.py
132horizon/dashboards/nova/instances_and_volumes/instances/__init__.py
133horizon/dashboards/nova/instances_and_volumes/instances/forms.py
134horizon/dashboards/nova/instances_and_volumes/instances/tables.py
135horizon/dashboards/nova/instances_and_volumes/instances/tabs.py
136horizon/dashboards/nova/instances_and_volumes/instances/tests.py
137horizon/dashboards/nova/instances_and_volumes/instances/urls.py
138horizon/dashboards/nova/instances_and_volumes/instances/views.py
139horizon/dashboards/nova/instances_and_volumes/volumes/__init__.py
140horizon/dashboards/nova/instances_and_volumes/volumes/forms.py
141horizon/dashboards/nova/instances_and_volumes/volumes/tables.py
142horizon/dashboards/nova/instances_and_volumes/volumes/tabs.py
143horizon/dashboards/nova/instances_and_volumes/volumes/tests.py
144horizon/dashboards/nova/instances_and_volumes/volumes/urls.py
145horizon/dashboards/nova/instances_and_volumes/volumes/views.py
146horizon/dashboards/nova/overview/__init__.py
147horizon/dashboards/nova/overview/panel.py
148horizon/dashboards/nova/overview/tests.py
149horizon/dashboards/nova/overview/urls.py
150horizon/dashboards/nova/overview/views.py
151horizon/dashboards/nova/templates/nova/base.html
152horizon/dashboards/nova/templates/nova/access_and_security/index.html
153horizon/dashboards/nova/templates/nova/access_and_security/floating_ips/_allocate.html
154horizon/dashboards/nova/templates/nova/access_and_security/floating_ips/_associate.html
155horizon/dashboards/nova/templates/nova/access_and_security/floating_ips/allocate.html
156horizon/dashboards/nova/templates/nova/access_and_security/floating_ips/associate.html
157horizon/dashboards/nova/templates/nova/access_and_security/keypairs/_create.html
158horizon/dashboards/nova/templates/nova/access_and_security/keypairs/_import.html
159horizon/dashboards/nova/templates/nova/access_and_security/keypairs/create.html
160horizon/dashboards/nova/templates/nova/access_and_security/keypairs/download.html
161horizon/dashboards/nova/templates/nova/access_and_security/keypairs/import.html
162horizon/dashboards/nova/templates/nova/access_and_security/security_groups/_create.html
163horizon/dashboards/nova/templates/nova/access_and_security/security_groups/_edit_rules.html
164horizon/dashboards/nova/templates/nova/access_and_security/security_groups/create.html
165horizon/dashboards/nova/templates/nova/access_and_security/security_groups/edit_rules.html
166horizon/dashboards/nova/templates/nova/containers/_create.html
167horizon/dashboards/nova/templates/nova/containers/create.html
168horizon/dashboards/nova/templates/nova/containers/index.html
169horizon/dashboards/nova/templates/nova/images_and_snapshots/index.html
170horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html
171horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_launch.html
172horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_update.html
173horizon/dashboards/nova/templates/nova/images_and_snapshots/images/detail.html
174horizon/dashboards/nova/templates/nova/images_and_snapshots/images/launch.html
175horizon/dashboards/nova/templates/nova/images_and_snapshots/images/update.html
176horizon/dashboards/nova/templates/nova/images_and_snapshots/snapshots/_create.html
177horizon/dashboards/nova/templates/nova/images_and_snapshots/snapshots/create.html
178horizon/dashboards/nova/templates/nova/instances_and_volumes/index.html
179horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_log.html
180horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html
181horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_vnc.html
182horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_instance_ips.html
183horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_update.html
184horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/detail.html
185horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/update.html
186horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_attach.html
187horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_create.html
188horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_create_snapshot.html
189horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html
190horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/attach.html
191horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/create.html
192horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/create_snapshot.html
193horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/detail.html
194horizon/dashboards/nova/templates/nova/objects/_copy.html
195horizon/dashboards/nova/templates/nova/objects/_upload.html
196horizon/dashboards/nova/templates/nova/objects/copy.html
197horizon/dashboards/nova/templates/nova/objects/index.html
198horizon/dashboards/nova/templates/nova/objects/upload.html
199horizon/dashboards/nova/templates/nova/overview/usage.csv
200horizon/dashboards/nova/templates/nova/overview/usage.html
201horizon/dashboards/settings/__init__.py
202horizon/dashboards/settings/dashboard.py
203horizon/dashboards/settings/models.py
204horizon/dashboards/settings/ec2/__init__.py
205horizon/dashboards/settings/ec2/forms.py
206horizon/dashboards/settings/ec2/panel.py
207horizon/dashboards/settings/ec2/tests.py
208horizon/dashboards/settings/ec2/urls.py
209horizon/dashboards/settings/ec2/views.py
210horizon/dashboards/settings/project/__init__.py
211horizon/dashboards/settings/project/forms.py
212horizon/dashboards/settings/project/panel.py
213horizon/dashboards/settings/project/urls.py
214horizon/dashboards/settings/project/views.py
215horizon/dashboards/settings/templates/settings/base.html
216horizon/dashboards/settings/templates/settings/ec2/download_form.html
217horizon/dashboards/settings/templates/settings/ec2/ec2rc.sh.template
218horizon/dashboards/settings/templates/settings/ec2/index.html
219horizon/dashboards/settings/templates/settings/project/_openrc.html
220horizon/dashboards/settings/templates/settings/project/openrc.sh.template
221horizon/dashboards/settings/templates/settings/project/settings.html
222horizon/dashboards/settings/templates/settings/user/_language.html
223horizon/dashboards/settings/templates/settings/user/settings.html
224horizon/dashboards/settings/user/__init__.py
225horizon/dashboards/settings/user/panel.py
226horizon/dashboards/settings/user/urls.py
227horizon/dashboards/settings/user/views.py
228horizon/dashboards/syspanel/__init__.py
229horizon/dashboards/syspanel/dashboard.py
230horizon/dashboards/syspanel/models.py
231horizon/dashboards/syspanel/flavors/__init__.py
232horizon/dashboards/syspanel/flavors/forms.py
233horizon/dashboards/syspanel/flavors/panel.py
234horizon/dashboards/syspanel/flavors/tables.py
235horizon/dashboards/syspanel/flavors/tests.py
236horizon/dashboards/syspanel/flavors/urls.py
237horizon/dashboards/syspanel/flavors/views.py
238horizon/dashboards/syspanel/images/__init__.py
239horizon/dashboards/syspanel/images/forms.py
240horizon/dashboards/syspanel/images/panel.py
241horizon/dashboards/syspanel/images/tables.py
242horizon/dashboards/syspanel/images/tests.py
243horizon/dashboards/syspanel/images/urls.py
244horizon/dashboards/syspanel/images/views.py
245horizon/dashboards/syspanel/instances/__init__.py
246horizon/dashboards/syspanel/instances/panel.py
247horizon/dashboards/syspanel/instances/tables.py
248horizon/dashboards/syspanel/instances/tests.py
249horizon/dashboards/syspanel/instances/urls.py
250horizon/dashboards/syspanel/instances/views.py
251horizon/dashboards/syspanel/overview/__init__.py
252horizon/dashboards/syspanel/overview/panel.py
253horizon/dashboards/syspanel/overview/urls.py
254horizon/dashboards/syspanel/overview/views.py
255horizon/dashboards/syspanel/projects/__init__.py
256horizon/dashboards/syspanel/projects/forms.py
257horizon/dashboards/syspanel/projects/panel.py
258horizon/dashboards/syspanel/projects/tables.py
259horizon/dashboards/syspanel/projects/tests.py
260horizon/dashboards/syspanel/projects/urls.py
261horizon/dashboards/syspanel/projects/views.py
262horizon/dashboards/syspanel/quotas/__init__.py
263horizon/dashboards/syspanel/quotas/panel.py
264horizon/dashboards/syspanel/quotas/tables.py
265horizon/dashboards/syspanel/quotas/tests.py
266horizon/dashboards/syspanel/quotas/urls.py
267horizon/dashboards/syspanel/quotas/views.py
268horizon/dashboards/syspanel/services/__init__.py
269horizon/dashboards/syspanel/services/panel.py
270horizon/dashboards/syspanel/services/tables.py
271horizon/dashboards/syspanel/services/tests.py
272horizon/dashboards/syspanel/services/urls.py
273horizon/dashboards/syspanel/services/views.py
274horizon/dashboards/syspanel/templates/syspanel/base.html
275horizon/dashboards/syspanel/templates/syspanel/flavors/_create.html
276horizon/dashboards/syspanel/templates/syspanel/flavors/create.html
277horizon/dashboards/syspanel/templates/syspanel/flavors/index.html
278horizon/dashboards/syspanel/templates/syspanel/images/_update.html
279horizon/dashboards/syspanel/templates/syspanel/images/index.html
280horizon/dashboards/syspanel/templates/syspanel/images/update.html
281horizon/dashboards/syspanel/templates/syspanel/instances/index.html
282horizon/dashboards/syspanel/templates/syspanel/overview/usage.csv
283horizon/dashboards/syspanel/templates/syspanel/overview/usage.html
284horizon/dashboards/syspanel/templates/syspanel/projects/_add_user.html
285horizon/dashboards/syspanel/templates/syspanel/projects/_create.html
286horizon/dashboards/syspanel/templates/syspanel/projects/_quotas.html
287horizon/dashboards/syspanel/templates/syspanel/projects/_update.html
288horizon/dashboards/syspanel/templates/syspanel/projects/add_user.html
289horizon/dashboards/syspanel/templates/syspanel/projects/create.html
290horizon/dashboards/syspanel/templates/syspanel/projects/index.html
291horizon/dashboards/syspanel/templates/syspanel/projects/quotas.html
292horizon/dashboards/syspanel/templates/syspanel/projects/update.html
293horizon/dashboards/syspanel/templates/syspanel/projects/usage.csv
294horizon/dashboards/syspanel/templates/syspanel/projects/usage.html
295horizon/dashboards/syspanel/templates/syspanel/projects/users.html
296horizon/dashboards/syspanel/templates/syspanel/quotas/index.html
297horizon/dashboards/syspanel/templates/syspanel/services/index.html
298horizon/dashboards/syspanel/templates/syspanel/users/_create.html
299horizon/dashboards/syspanel/templates/syspanel/users/_update.html
300horizon/dashboards/syspanel/templates/syspanel/users/create.html
301horizon/dashboards/syspanel/templates/syspanel/users/index.html
302horizon/dashboards/syspanel/templates/syspanel/users/update.html
303horizon/dashboards/syspanel/users/__init__.py
304horizon/dashboards/syspanel/users/forms.py
305horizon/dashboards/syspanel/users/panel.py
306horizon/dashboards/syspanel/users/tables.py
307horizon/dashboards/syspanel/users/tests.py
308horizon/dashboards/syspanel/users/urls.py
309horizon/dashboards/syspanel/users/views.py
310horizon/forms/__init__.py
311horizon/forms/base.py
312horizon/forms/views.py
313horizon/locale/es/LC_MESSAGES/django.mo
314horizon/locale/es/LC_MESSAGES/django.po
315horizon/locale/fr/LC_MESSAGES/django.mo
316horizon/locale/fr/LC_MESSAGES/django.po
317horizon/locale/ja/LC_MESSAGES/django.mo
318horizon/locale/ja/LC_MESSAGES/django.po
319horizon/locale/pl/LC_MESSAGES/django.mo
320horizon/locale/pl/LC_MESSAGES/django.po
321horizon/locale/pt/LC_MESSAGES/django.mo
322horizon/locale/pt/LC_MESSAGES/django.po
323horizon/locale/zh_CN/LC_MESSAGES/django.po
324horizon/locale/zh_TW/LC_MESSAGES/django.mo
325horizon/locale/zh_TW/LC_MESSAGES/django.po
326horizon/static/horizon/js/form_examples.js
327horizon/static/horizon/js/forms.js
328horizon/static/horizon/js/hogan-1.0.5.min.js
329horizon/static/horizon/js/horizon.js
330horizon/static/horizon/js/json2.js
331horizon/static/horizon/js/modals.js
332horizon/static/horizon/js/plugins.js
333horizon/static/horizon/js/tables.js
334horizon/static/horizon/js/tabs.js
335horizon/static/horizon/js/jquery/jquery-ui.min.js
336horizon/static/horizon/js/jquery/jquery.cookie.js
337horizon/static/horizon/js/jquery/jquery.example.min.js
338horizon/static/horizon/js/jquery/jquery.min.js
339horizon/static/horizon/js/jquery/jquery.quicksearch.js
340horizon/static/horizon/js/jquery/jquery.table-sorter.js
341horizon/tables/__init__.py
342horizon/tables/actions.py
343horizon/tables/base.py
344horizon/tables/views.py
345horizon/tabs/__init__.py
346horizon/tabs/base.py
347horizon/tabs/views.py
348horizon/templates/horizon/_messages.html
349horizon/templates/horizon/_nav_list.html
350horizon/templates/horizon/_subnav_list.html
351horizon/templates/horizon/auth/_login.html
352horizon/templates/horizon/auth/login.html
353horizon/templates/horizon/client_side/_alert_message.html
354horizon/templates/horizon/client_side/_modal.html
355horizon/templates/horizon/client_side/_table_row.html
356horizon/templates/horizon/client_side/conf.html
357horizon/templates/horizon/client_side/template.html
358horizon/templates/horizon/client_side/templates.html
359horizon/templates/horizon/common/_data_table.html
360horizon/templates/horizon/common/_data_table_row.html
361horizon/templates/horizon/common/_data_table_row_action.html
362horizon/templates/horizon/common/_data_table_row_actions.html
363horizon/templates/horizon/common/_data_table_table_actions.html
364horizon/templates/horizon/common/_detail_table.html
365horizon/templates/horizon/common/_form_fields.html
366horizon/templates/horizon/common/_modal_form.html
367horizon/templates/horizon/common/_page_header.html
368horizon/templates/horizon/common/_progress_bar.html
369horizon/templates/horizon/common/_region_selector.html
370horizon/templates/horizon/common/_sidebar.html
371horizon/templates/horizon/common/_sidebar_module.html
372horizon/templates/horizon/common/_tab_group.html
373horizon/templates/horizon/common/_usage_summary.html
374horizon/templatetags/__init__.py
375horizon/templatetags/branding.py
376horizon/templatetags/horizon.py
377horizon/templatetags/parse_date.py
378horizon/templatetags/sizeformat.py
379horizon/templatetags/truncate_filter.py
380horizon/tests/__init__.py
381horizon/tests/auth_tests.py
382horizon/tests/authors_tests.py
383horizon/tests/base_tests.py
384horizon/tests/context_processor_tests.py
385horizon/tests/table_tests.py
386horizon/tests/tabs_tests.py
387horizon/tests/templatetag_tests.py
388horizon/tests/test_panel_urls.py
389horizon/tests/testsettings.py
390horizon/tests/testurls.py
391horizon/tests/utils_tests.py
392horizon/tests/views.py
393horizon/tests/api_tests/__init__.py
394horizon/tests/api_tests/base_tests.py
395horizon/tests/api_tests/glance_tests.py
396horizon/tests/api_tests/keystone_tests.py
397horizon/tests/api_tests/nova_tests.py
398horizon/tests/api_tests/swift_tests.py
399horizon/tests/templates/404.html
400horizon/tests/templates/_tab.html
401horizon/tests/templates/base-sidebar.html
402horizon/tests/templates/base.html
403horizon/tests/templates/splash.html
404horizon/tests/templates/switch_tenants.html
405horizon/tests/templates/tab_group.html
406horizon/tests/test_data/__init__.py
407horizon/tests/test_data/glance_data.py
408horizon/tests/test_data/keystone_data.py
409horizon/tests/test_data/nova_data.py
410horizon/tests/test_data/swift_data.py
411horizon/tests/test_data/utils.py
412horizon/usage/__init__.py
413horizon/usage/base.py
414horizon/usage/tables.py
415horizon/usage/views.py
416horizon/utils/__init__.py
417horizon/utils/filters.py
418horizon/utils/html.py
419horizon/utils/reverse_bugfix.py
420horizon/utils/validators.py
421horizon/views/__init__.py
422horizon/views/auth.py
423horizon/views/auth_forms.py
424horizon/views/base.py
425openstack_dashboard/__init__.py
426openstack_dashboard/middleware.py
427openstack_dashboard/settings.py
428openstack_dashboard/tests.py
429openstack_dashboard/urls.py
430openstack_dashboard/views.py
431openstack_dashboard/local/__init__.py
432openstack_dashboard/local/local_settings.py.example
433openstack_dashboard/locale/es/LC_MESSAGES/django.po
434openstack_dashboard/locale/fr/LC_MESSAGES/django.po
435openstack_dashboard/locale/ja/LC_MESSAGES/django.po
436openstack_dashboard/locale/pl/LC_MESSAGES/django.po
437openstack_dashboard/locale/pt/LC_MESSAGES/django.po
438openstack_dashboard/locale/zh_CN/LC_MESSAGES/django.po
439openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.mo
440openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.po
441openstack_dashboard/static/bootstrap/css/bootstrap-responsive.css
442openstack_dashboard/static/bootstrap/css/bootstrap-responsive.min.css
443openstack_dashboard/static/bootstrap/css/bootstrap.css
444openstack_dashboard/static/bootstrap/css/bootstrap.min.css
445openstack_dashboard/static/bootstrap/img/glyphicons-halflings-white.png
446openstack_dashboard/static/bootstrap/img/glyphicons-halflings.png
447openstack_dashboard/static/bootstrap/js/bootstrap.js
448openstack_dashboard/static/bootstrap/js/bootstrap.min.js
449openstack_dashboard/static/dashboard/css/style.css
450openstack_dashboard/static/dashboard/fonts/Anivers_Regular-webfont.eot
451openstack_dashboard/static/dashboard/fonts/Anivers_Regular-webfont.svg
452openstack_dashboard/static/dashboard/fonts/Anivers_Regular-webfont.ttf
453openstack_dashboard/static/dashboard/fonts/Anivers_Regular-webfont.woff
454openstack_dashboard/static/dashboard/img/drop_arrow.png
455openstack_dashboard/static/dashboard/img/favicon.ico
456openstack_dashboard/static/dashboard/img/logo.png
457openstack_dashboard/static/dashboard/img/right_droparrow.png
458openstack_dashboard/static/dashboard/img/search.png
459openstack_dashboard/static/dashboard/img/spinner.gif
460openstack_dashboard/static/qunit/qunit.css
461openstack_dashboard/static/qunit/qunit.js
462openstack_dashboard/templates/403.html
463openstack_dashboard/templates/404.html
464openstack_dashboard/templates/500.html
465openstack_dashboard/templates/_footer.html
466openstack_dashboard/templates/_header.html
467openstack_dashboard/templates/_scripts.html
468openstack_dashboard/templates/_stylesheets.html
469openstack_dashboard/templates/base.html
470openstack_dashboard/templates/qunit.html
471openstack_dashboard/templates/splash.html
472openstack_dashboard/templates/switch_tenants.html
473openstack_dashboard/wsgi/django.wsgi
474tools/install_venv.py
475tools/pip-requires
476tools/rfc.sh
477tools/test-requires
478tools/with_venv.sh
0\ No newline at end of file479\ No newline at end of file
1480
=== added file 'horizon.egg-info/dependency_links.txt'
--- horizon.egg-info/dependency_links.txt 1970-01-01 00:00:00 +0000
+++ horizon.egg-info/dependency_links.txt 2013-04-24 15:22:28 +0000
@@ -0,0 +1,3 @@
1http://github.com/openstack/python-novaclient/tarball/master#egg=python-novaclient
2http://github.com/openstack/python-keystoneclient/tarball/master#egg=python-keystoneclient
3http://github.com/openstack/glance@stable/essex#egg=glance
04
=== added file 'horizon.egg-info/not-zip-safe'
--- horizon.egg-info/not-zip-safe 1970-01-01 00:00:00 +0000
+++ horizon.egg-info/not-zip-safe 2013-04-24 15:22:28 +0000
@@ -0,0 +1,1 @@
1
02
=== added file 'horizon.egg-info/requires.txt'
--- horizon.egg-info/requires.txt 1970-01-01 00:00:00 +0000
+++ horizon.egg-info/requires.txt 2013-04-24 15:22:28 +0000
@@ -0,0 +1,18 @@
1Django>=1.3
2python-cloudfiles
3python-dateutil
4django-nose
5PasteDeploy
6eventlet
7kombu
8paste
9pycrypto==2.3
10routes
11sqlalchemy
12sqlalchemy-migrate
13webob==1.0.8
14xattr
15iso8601
16python-novaclient
17python-keystoneclient
18glance
0\ No newline at end of file19\ No newline at end of file
120
=== added file 'horizon.egg-info/top_level.txt'
--- horizon.egg-info/top_level.txt 1970-01-01 00:00:00 +0000
+++ horizon.egg-info/top_level.txt 2013-04-24 15:22:28 +0000
@@ -0,0 +1,2 @@
1openstack_dashboard
2horizon
03
=== modified file 'horizon/dashboards/nova/images_and_snapshots/images/tables.py'
--- horizon/dashboards/nova/images_and_snapshots/images/tables.py 2012-08-24 03:27:33 +0000
+++ horizon/dashboards/nova/images_and_snapshots/images/tables.py 2013-04-24 15:22:28 +0000
@@ -100,3 +100,6 @@
100 table_actions = (DeleteImage,)100 table_actions = (DeleteImage,)
101 row_actions = (LaunchImage, EditImage, DeleteImage)101 row_actions = (LaunchImage, EditImage, DeleteImage)
102 pagination_param = "image_marker"102 pagination_param = "image_marker"
103
104 def get_object_display(self, obj):
105 return obj.name or obj.id
103106
=== modified file 'horizon/dashboards/nova/instances_and_volumes/volumes/tables.py'
--- horizon/dashboards/nova/instances_and_volumes/volumes/tables.py 2012-08-24 03:27:33 +0000
+++ horizon/dashboards/nova/instances_and_volumes/volumes/tables.py 2013-04-24 15:22:28 +0000
@@ -119,7 +119,7 @@
119 status_choices=STATUS_CHOICES)119 status_choices=STATUS_CHOICES)
120120
121 def get_object_display(self, obj):121 def get_object_display(self, obj):
122 return obj.display_name122 return obj.display_name or obj.id
123123
124124
125class VolumesTable(VolumesTableBase):125class VolumesTable(VolumesTableBase):
126126
=== added file 'horizon/dashboards/settings/juju/__init__.py'
--- horizon/dashboards/settings/juju/__init__.py 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/juju/__init__.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,1 @@
1# Horizon Juju settings panel
02
=== removed file 'horizon/dashboards/settings/juju/__init__.py'
--- horizon/dashboards/settings/juju/__init__.py 2012-04-12 12:42:04 +0000
+++ horizon/dashboards/settings/juju/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1# Horizon Juju settings panel
20
=== added file 'horizon/dashboards/settings/juju/forms.py'
--- horizon/dashboards/settings/juju/forms.py 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/juju/forms.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,96 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Canonical Ltd.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18import logging
19import tempfile
20import zipfile
21from contextlib import closing
22
23from django import http, shortcuts
24from django.contrib import messages
25from django.template.loader import render_to_string
26from django.utils.translation import ugettext_lazy as _
27from horizon import api
28from horizon import exceptions
29from horizon import forms
30
31import boto
32import uuid
33
34LOG = logging.getLogger(__name__)
35
36
37class DownloadJujuEnvironment(forms.SelfHandlingForm):
38 # This is heavily based off the ec2 credentials form
39 tenant = forms.ChoiceField(label=_("Select a Project"))
40 @classmethod
41 def _instantiate(cls, request, *args, **kwargs):
42 return cls(request, *args, **kwargs)
43
44 def __init__(self, request, *args, **kwargs):
45 super(DownloadJujuEnvironment, self).__init__(*args, **kwargs)
46 tenant_choices = []
47 try:
48 tenant_list = api.keystone.tenant_list(request)
49 except:
50 tenant_list = []
51 exceptions.handle(request, _("Unable to retrieve tenant list."))
52
53 for tenant in tenant_list:
54 if tenant.enabled:
55 tenant_choices.append((tenant.id, tenant.name))
56 if not tenant_choices:
57 self.fields['tenant'].choices = ('', 'No Available Tenants')
58 else:
59 self.fields['tenant'].choices = tenant_choices
60
61 def handle(self, request, data):
62 def find_or_create_access_keys(request, tenant_id):
63 keys = api.keystone.list_ec2_credentials(request, request.user.id)
64 if keys:
65 return keys[0]
66 else:
67 return api.keystone.create_ec2_credentials(request,
68 request.user.id,
69 tenant_id)
70 try:
71 api.keystone.token_create_scoped(request,
72 data.get('tenant'),
73 request.user.token)
74 keys = find_or_create_access_keys(request, data.get('tenant'))
75 tenant_id = data['tenant']
76 tenant_name = dict(self.fields['tenant'].choices)[tenant_id]
77 control_bucket = "juju-openstack-%s-%s" % (tenant_name, str(uuid.uuid4())[19:])
78 context = {'ec2_access_key': keys.access,
79 'ec2_secret_key': keys.secret,
80 'ec2_url': api.url_for(request, 'ec2'),
81 's3_url': api.url_for(request, 's3'),
82 'juju_admin_secret': uuid.uuid4().hex,
83 'control_bucket': control_bucket
84 }
85 except Exception, e:
86 LOG.exception("S3 endpoint required for Juju environments.yaml creation.")
87 messages.error(request, _('Could not generate environment config: %s') % e)
88 return shortcuts.redirect(request.build_absolute_uri())
89
90 response = shortcuts.render(request,
91 'settings/juju/environments.yaml.template',
92 context,
93 content_type='text/plain')
94 response['Content-Disposition'] = 'attachment; filename=environments.yaml'
95 response['Content-Length'] = str(len(response.content))
96 return response
097
=== removed file 'horizon/dashboards/settings/juju/forms.py'
--- horizon/dashboards/settings/juju/forms.py 2012-08-24 03:27:33 +0000
+++ horizon/dashboards/settings/juju/forms.py 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Canonical Ltd.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18import logging
19import tempfile
20import zipfile
21from contextlib import closing
22
23from django import http, shortcuts
24from django.contrib import messages
25from django.template.loader import render_to_string
26from django.utils.translation import ugettext_lazy as _
27from horizon import api
28from horizon import exceptions
29from horizon import forms
30
31import boto
32import uuid
33
34LOG = logging.getLogger(__name__)
35
36
37class DownloadJujuEnvironment(forms.SelfHandlingForm):
38 # This is heavily based off the ec2 credentials form
39 tenant = forms.ChoiceField(label=_("Select a Project"))
40 @classmethod
41 def _instantiate(cls, request, *args, **kwargs):
42 return cls(request, *args, **kwargs)
43
44 def __init__(self, request, *args, **kwargs):
45 super(DownloadJujuEnvironment, self).__init__(*args, **kwargs)
46 tenant_choices = []
47 try:
48 tenant_list = api.keystone.tenant_list(request)
49 except:
50 tenant_list = []
51 exceptions.handle(request, _("Unable to retrieve tenant list."))
52
53 for tenant in tenant_list:
54 if tenant.enabled:
55 tenant_choices.append((tenant.id, tenant.name))
56 if not tenant_choices:
57 self.fields['tenant'].choices = ('', 'No Available Tenants')
58 else:
59 self.fields['tenant'].choices = tenant_choices
60
61 def handle(self, request, data):
62 def find_or_create_access_keys(request, tenant_id):
63 keys = api.keystone.list_ec2_credentials(request, request.user.id)
64 if keys:
65 return keys[0]
66 else:
67 return api.keystone.create_ec2_credentials(request,
68 request.user.id,
69 tenant_id)
70 try:
71 api.keystone.token_create_scoped(request,
72 data.get('tenant'),
73 request.user.token)
74 keys = find_or_create_access_keys(request, data.get('tenant'))
75 tenant_id = data['tenant']
76 tenant_name = dict(self.fields['tenant'].choices)[tenant_id]
77 control_bucket = "juju-openstack-%s-%s" % (tenant_name, str(uuid.uuid4())[19:])
78 context = {'ec2_access_key': keys.access,
79 'ec2_secret_key': keys.secret,
80 'ec2_url': api.url_for(request, 'ec2'),
81 's3_url': api.url_for(request, 's3'),
82 'juju_admin_secret': uuid.uuid4().hex,
83 'control_bucket': control_bucket
84 }
85 except Exception, e:
86 LOG.exception("S3 endpoint required for Juju environments.yaml creation.")
87 messages.error(request, _('Could not generate environment config: %s') % e)
88 return shortcuts.redirect(request.build_absolute_uri())
89
90 response = shortcuts.render(request,
91 'settings/juju/environments.yaml.template',
92 context,
93 content_type='text/plain')
94 response['Content-Disposition'] = 'attachment; filename=environments.yaml'
95 response['Content-Length'] = str(len(response.content))
96 return response
970
=== added file 'horizon/dashboards/settings/juju/panel.py'
--- horizon/dashboards/settings/juju/panel.py 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/juju/panel.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,28 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2# Copyright 2012 Openstack, LLC
3# Copyright 2012 Canonical Ltd.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17from django.utils.translation import ugettext_lazy as _
18
19import horizon
20from horizon.dashboards.settings import dashboard
21
22
23class JujuPanel(horizon.Panel):
24 name = _("Juju Environment Config")
25 slug = 'juju'
26
27
28dashboard.Settings.register(JujuPanel)
029
=== removed file 'horizon/dashboards/settings/juju/panel.py'
--- horizon/dashboards/settings/juju/panel.py 2012-04-12 12:42:04 +0000
+++ horizon/dashboards/settings/juju/panel.py 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2# Copyright 2012 Openstack, LLC
3# Copyright 2012 Canonical Ltd.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17from django.utils.translation import ugettext_lazy as _
18
19import horizon
20from horizon.dashboards.settings import dashboard
21
22
23class JujuPanel(horizon.Panel):
24 name = _("Juju Environment Config")
25 slug = 'juju'
26
27
28dashboard.Settings.register(JujuPanel)
290
=== added file 'horizon/dashboards/settings/juju/urls.py'
--- horizon/dashboards/settings/juju/urls.py 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/juju/urls.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,24 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Canonical Ltd.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18from django.conf.urls.defaults import patterns, url
19
20from .views import IndexView
21
22urlpatterns = patterns('horizon.dashboards.settings.juju.views',
23 url(r'^$', IndexView.as_view(), name='index'),
24)
025
=== removed file 'horizon/dashboards/settings/juju/urls.py'
--- horizon/dashboards/settings/juju/urls.py 2012-04-12 12:42:04 +0000
+++ horizon/dashboards/settings/juju/urls.py 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4# Copyright 2012 Canonical Ltd.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18from django.conf.urls.defaults import patterns, url
19
20from .views import IndexView
21
22urlpatterns = patterns('horizon.dashboards.settings.juju.views',
23 url(r'^$', IndexView.as_view(), name='index'),
24)
250
=== added file 'horizon/dashboards/settings/juju/views.py'
--- horizon/dashboards/settings/juju/views.py 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/juju/views.py 2013-04-24 15:22:28 +0000
@@ -0,0 +1,28 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17import logging
18
19from horizon import forms
20from horizon.dashboards.settings.juju.forms import DownloadJujuEnvironment
21
22
23LOG = logging.getLogger(__name__)
24
25
26class IndexView(forms.ModalFormView):
27 form_class = DownloadJujuEnvironment
28 template_name = 'settings/juju/index.html'
029
=== removed file 'horizon/dashboards/settings/juju/views.py'
--- horizon/dashboards/settings/juju/views.py 2012-04-12 12:42:04 +0000
+++ horizon/dashboards/settings/juju/views.py 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 Openstack, LLC
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17import logging
18
19from horizon import forms
20from horizon.dashboards.settings.juju.forms import DownloadJujuEnvironment
21
22
23LOG = logging.getLogger(__name__)
24
25
26class IndexView(forms.ModalFormView):
27 form_class = DownloadJujuEnvironment
28 template_name = 'settings/juju/index.html'
290
=== added file 'horizon/dashboards/settings/templates/settings/juju/download_form.html'
--- horizon/dashboards/settings/templates/settings/juju/download_form.html 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/templates/settings/juju/download_form.html 2013-04-24 15:22:28 +0000
@@ -0,0 +1,20 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3
4
5{% block modal-body %}
6<div class="left">
7 <fieldset>
8 {% include "horizon/common/_form_fields.html" %}
9 </fieldset>
10</div>
11<div class="right">
12 <h3>{% trans "Description:" %}</h3>
13 <p>{% trans 'Clicking "Download Juju Environment Config" will download a file which includes a Juju environment configured for your cloud.<br><center><img src='/static/dashboard/img/juju.png'></center><br>To find out more about Juju visit <a href='http://juju.ubuntu.com'>http://juju.ubuntu.com</a>' %}</p>
14</div>
15{% endblock %}
16
17{% block modal-footer %}
18 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Download Juju Environment Config" %}" />
19 {% if hide %}<a href="{% url horizon:settings:juju:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
20{% endblock %}
021
=== removed file 'horizon/dashboards/settings/templates/settings/juju/download_form.html'
--- horizon/dashboards/settings/templates/settings/juju/download_form.html 2012-04-23 10:04:39 +0000
+++ horizon/dashboards/settings/templates/settings/juju/download_form.html 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3
4
5{% block modal-body %}
6<div class="left">
7 <fieldset>
8 {% include "horizon/common/_form_fields.html" %}
9 </fieldset>
10</div>
11<div class="right">
12 <h3>{% trans "Description:" %}</h3>
13 <p>{% trans 'Clicking "Download Juju Environment Config" will download a file which includes a Juju environment configured for your cloud.<br><center><img src='/static/dashboard/img/juju.png'></center><br>To find out more about Juju visit <a href='http://juju.ubuntu.com'>http://juju.ubuntu.com</a>' %}</p>
14</div>
15{% endblock %}
16
17{% block modal-footer %}
18 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Download Juju Environment Config" %}" />
19 {% if hide %}<a href="{% url horizon:settings:juju:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
20{% endblock %}
210
=== added file 'horizon/dashboards/settings/templates/settings/juju/environments.yaml.template'
--- horizon/dashboards/settings/templates/settings/juju/environments.yaml.template 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/templates/settings/juju/environments.yaml.template 2013-04-24 15:22:28 +0000
@@ -0,0 +1,21 @@
1# To use Juju with your Openstack cloud:
2# 1. Run: apt-get install juju
3# 2. Copy this file to $HOME/.juju/environments.yaml
4# 3. Modify the 'default-image-id' to match an Ubuntu cloud image
5# AMI that has been published to your cloud.
6# 4. Run 'juju bootstrap' and deploy services!
7#
8# To find out more about juju visit http://juju.ubuntu.com
9
10juju: environments
11environments:
12 openstack:
13 type: ec2
14 control-bucket: {{ control_bucket }}
15 admin-secret: {{ juju_admin_secret }}
16 access-key: {{ ec2_access_key }}
17 secret-key: {{ ec2_secret_key }}
18 ec2-uri: {{ ec2_url }}
19 s3-uri: {{ s3_url }}
20 default-series: precise
21 default-image-id: ami-00000001
022
=== removed file 'horizon/dashboards/settings/templates/settings/juju/environments.yaml.template'
--- horizon/dashboards/settings/templates/settings/juju/environments.yaml.template 2012-04-12 12:42:04 +0000
+++ horizon/dashboards/settings/templates/settings/juju/environments.yaml.template 1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
1# To use Juju with your Openstack cloud:
2# 1. Run: apt-get install juju
3# 2. Copy this file to $HOME/.juju/environments.yaml
4# 3. Modify the 'default-image-id' to match an Ubuntu cloud image
5# AMI that has been published to your cloud.
6# 4. Run 'juju bootstrap' and deploy services!
7#
8# To find out more about juju visit http://juju.ubuntu.com
9
10juju: environments
11environments:
12 openstack:
13 type: ec2
14 control-bucket: {{ control_bucket }}
15 admin-secret: {{ juju_admin_secret }}
16 access-key: {{ ec2_access_key }}
17 secret-key: {{ ec2_secret_key }}
18 ec2-uri: {{ ec2_url }}
19 s3-uri: {{ s3_url }}
20 default-series: precise
21 default-image-id: ami-00000001
220
=== added file 'horizon/dashboards/settings/templates/settings/juju/index.html'
--- horizon/dashboards/settings/templates/settings/juju/index.html 1970-01-01 00:00:00 +0000
+++ horizon/dashboards/settings/templates/settings/juju/index.html 2013-04-24 15:22:28 +0000
@@ -0,0 +1,11 @@
1{% extends 'settings/base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Download Juju Environment Config" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Download Juju Environment Config") %}
7{% endblock page_header %}
8
9{% block settings_main %}
10 {% include "settings/juju/download_form.html" %}
11{% endblock %}
012
=== removed file 'horizon/dashboards/settings/templates/settings/juju/index.html'
--- horizon/dashboards/settings/templates/settings/juju/index.html 2012-04-12 12:42:04 +0000
+++ horizon/dashboards/settings/templates/settings/juju/index.html 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
1{% extends 'settings/base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Download Juju Environment Config" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Download Juju Environment Config") %}
7{% endblock page_header %}
8
9{% block settings_main %}
10 {% include "settings/juju/download_form.html" %}
11{% endblock %}
120
=== modified file 'horizon/usage/base.py'
--- horizon/usage/base.py 2012-03-02 12:11:59 +0000
+++ horizon/usage/base.py 2013-04-24 15:22:28 +0000
@@ -68,15 +68,13 @@
6868
69 def get_form(self):69 def get_form(self):
70 if not hasattr(self, 'form'):70 if not hasattr(self, 'form'):
71 if (any(key in ['month', 'year']71 if any(key in ['month', 'year'] for key in self.request.GET):
72 for key in self.request.GET.keys())):
73 # bound form72 # bound form
74 self.form = forms.DateForm(self.request.GET)73 self.form = forms.DateForm(self.request.GET)
75 else:74 else:
76 # non-bound form75 # non-bound form
77 self.form = forms.DateForm(initial={76 self.form = forms.DateForm(initial={'month': self.today.month,
78 'month': self.today.month,77 'year': self.today.year})
79 'year': self.today.year})
80 return self.form78 return self.form
8179
82 def get_usage_list(self, start, end):80 def get_usage_list(self, start, end):
@@ -104,7 +102,12 @@
104 self.summary[key] += value102 self.summary[key] += value
105103
106 def csv_link(self):104 def csv_link(self):
107 return "?date_month=%s&date_year=%s&format=csv" % self.get_date_range()105 form = self.get_form()
106 if hasattr(form, "cleaned_data"):
107 data = form.cleaned_data
108 else:
109 data = {"month": self.today.month, "year": self.today.year}
110 return "?month=%s&year=%s&format=csv" % (data['month'], data['year'])
108111
109112
110class GlobalUsage(BaseUsage):113class GlobalUsage(BaseUsage):
111114
=== modified file 'horizon/version.py'
--- horizon/version.py 2012-08-24 03:27:33 +0000
+++ horizon/version.py 2013-04-24 15:22:28 +0000
@@ -19,7 +19,7 @@
19 'revno': 0}19 'revno': 0}
2020
2121
22HORIZON_VERSION = ['2012', '1', '3']22HORIZON_VERSION = ['2012', '1', '4']
23YEAR, COUNT, REVISION = HORIZON_VERSION23YEAR, COUNT, REVISION = HORIZON_VERSION
24FINAL = False # This becomes true at Release Candidate time24FINAL = False # This becomes true at Release Candidate time
2525
2626
=== added file 'setup.cfg'
--- setup.cfg 1970-01-01 00:00:00 +0000
+++ setup.cfg 2013-04-24 15:22:28 +0000
@@ -0,0 +1,5 @@
1[egg_info]
2tag_build =
3tag_date = 0
4tag_svn_revision = 0
5
06
=== modified file 'tools/pip-requires'
--- tools/pip-requires 2012-08-24 03:27:33 +0000
+++ tools/pip-requires 2013-04-24 15:22:28 +0000
@@ -20,4 +20,4 @@
20# Horizon Non-pip Requirements20# Horizon Non-pip Requirements
21-e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient21-e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient
22-e git+https://github.com/openstack/python-keystoneclient.git#egg=python-keystoneclient22-e git+https://github.com/openstack/python-keystoneclient.git#egg=python-keystoneclient
23-e git+https://github.com/openstack/glance.git#egg=glance23-e git+https://github.com/openstack/glance@stable/essex#egg=glance
2424
=== removed file 'tox.ini'
--- tox.ini 2012-08-24 03:27:33 +0000
+++ tox.ini 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1[tox]
2envlist = py26,py27,pep8
3
4[testenv]
5setenv = VIRTUAL_ENV={envdir}
6 NOSE_WITH_OPENSTACK=1
7 NOSE_OPENSTACK_COLOR=1
8 NOSE_OPENSTACK_RED=0.05
9 NOSE_OPENSTACK_YELLOW=0.025
10 NOSE_OPENSTACK_SHOW_ELAPSED=1
11deps = -r{toxinidir}/tools/pip-requires
12 -r{toxinidir}/tools/test-requires
13commands = /bin/bash run_tests.sh -N
14
15[tox:jenkins]
16downloadcache = ~/cache/pip
17
18[testenv:pep8]
19deps = pep8==1.1
20commands = /bin/bash run_tests.sh -N --pep8
21
22[testenv:cover]
23commands = /bin/bash run_tests.sh -N --coverage
24
25[testenv:venv]
26commands = {posargs}

Subscribers

People subscribed via source and target branches

to all changes: