Removing translation to work with Django 1.7.x
Django 1.7.x changed such that trying to use any of the translation functions prior to instantiating the wsgi app results in failures. Removing all translation until it can be handled properly with Django 1.7.x or greater. Change-Id: I0725e64001a8ae877e6e1422d5aa8ca81e2d1aa4
This commit is contained in:
parent
09c6138914
commit
441145c65c
|
@ -1,5 +1,3 @@
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
PANEL_GROUP = 'messagebroker'
|
PANEL_GROUP = 'messagebroker'
|
||||||
PANEL_GROUP_NAME = _('Message Broker')
|
PANEL_GROUP_NAME = 'Message Broker'
|
||||||
PANEL_GROUP_DASHBOARD = 'project'
|
PANEL_GROUP_DASHBOARD = 'project'
|
||||||
|
|
|
@ -16,11 +16,10 @@
|
||||||
# Copyright [2014] Hewlett-Packard Development Company, L.P.
|
# Copyright [2014] Hewlett-Packard Development Company, L.P.
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
|
|
||||||
class CuePanel(horizon.Panel):
|
class CuePanel(horizon.Panel):
|
||||||
name = _("Clusters")
|
name = "Clusters"
|
||||||
slug = 'messagebroker'
|
slug = 'messagebroker'
|
||||||
permissions = ('openstack.services.message-broker',)
|
permissions = ('openstack.services.message-broker',)
|
||||||
|
|
|
@ -18,14 +18,13 @@
|
||||||
|
|
||||||
from cuedashboard import api
|
from cuedashboard import api
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
|
||||||
from django.utils.translation import ungettext_lazy
|
from django.utils.translation import ungettext_lazy
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
|
|
||||||
|
|
||||||
class CreateCluster(tables.LinkAction):
|
class CreateCluster(tables.LinkAction):
|
||||||
name = "create"
|
name = "create"
|
||||||
verbose_name = _("Create Cluster")
|
verbose_name = "Create Cluster"
|
||||||
url = "horizon:project:messagebroker:create"
|
url = "horizon:project:messagebroker:create"
|
||||||
classes = ("ajax-modal", "btn-create")
|
classes = ("ajax-modal", "btn-create")
|
||||||
|
|
||||||
|
@ -72,15 +71,15 @@ def format_endpoints(cluster):
|
||||||
|
|
||||||
class ClusterTable(tables.DataTable):
|
class ClusterTable(tables.DataTable):
|
||||||
name = tables.Column("name",
|
name = tables.Column("name",
|
||||||
verbose_name=_("Name"),
|
verbose_name="Name",
|
||||||
link='horizon:project:messagebroker:detail')
|
link='horizon:project:messagebroker:detail')
|
||||||
size = tables.Column("size", verbose_name=_("Cluster Size"),)
|
size = tables.Column("size", verbose_name="Cluster Size",)
|
||||||
endpoint = tables.Column(format_endpoints, verbose_name=_("Endpoints"))
|
endpoint = tables.Column(format_endpoints, verbose_name="Endpoints")
|
||||||
status = tables.Column("status", verbose_name=_("Status"))
|
status = tables.Column("status", verbose_name="Status")
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
name = "clusters"
|
name = "clusters"
|
||||||
verbose_name = _("Clusters")
|
verbose_name = "Clusters"
|
||||||
row_class = UpdateRow
|
row_class = UpdateRow
|
||||||
table_actions = (CreateCluster, DeleteCluster,)
|
table_actions = (CreateCluster, DeleteCluster,)
|
||||||
row_actions = (DeleteCluster,)
|
row_actions = (DeleteCluster,)
|
||||||
|
|
|
@ -14,12 +14,11 @@
|
||||||
# Copyright [2014] Hewlett-Packard Development Company, L.P.
|
# Copyright [2014] Hewlett-Packard Development Company, L.P.
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
|
|
||||||
|
|
||||||
class OverviewTab(tabs.Tab):
|
class OverviewTab(tabs.Tab):
|
||||||
name = _("Overview")
|
name = "Overview"
|
||||||
slug = "overview"
|
slug = "overview"
|
||||||
template_name = "project/messagebroker/_detail_overview.html"
|
template_name = "project/messagebroker/_detail_overview.html"
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ from cuedashboard.messagebroker.tabs import ClusterDetailTabs
|
||||||
from cuedashboard.messagebroker import workflows as cue_workflows
|
from cuedashboard.messagebroker import workflows as cue_workflows
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
from horizon import tabs as horizon_tabs
|
from horizon import tabs as horizon_tabs
|
||||||
from horizon.utils import memoized
|
from horizon.utils import memoized
|
||||||
|
@ -32,7 +31,7 @@ from horizon import workflows
|
||||||
class IndexView(tables.DataTableView):
|
class IndexView(tables.DataTableView):
|
||||||
table_class = ClusterTable
|
table_class = ClusterTable
|
||||||
template_name = 'messagebroker/index.html'
|
template_name = 'messagebroker/index.html'
|
||||||
page_title = _("Clusters")
|
page_title = "Clusters"
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return api.clusters_list(self.request)
|
return api.clusters_list(self.request)
|
||||||
|
@ -41,13 +40,13 @@ class IndexView(tables.DataTableView):
|
||||||
class CreateClusterView(workflows.WorkflowView):
|
class CreateClusterView(workflows.WorkflowView):
|
||||||
workflow_class = cue_workflows.CreateCluster
|
workflow_class = cue_workflows.CreateCluster
|
||||||
template_name = "messagebroker/launch.html"
|
template_name = "messagebroker/launch.html"
|
||||||
page_title = _("Create Cluster")
|
page_title = "Create Cluster"
|
||||||
|
|
||||||
|
|
||||||
class DetailView(horizon_tabs.TabbedTableView):
|
class DetailView(horizon_tabs.TabbedTableView):
|
||||||
tab_group_class = ClusterDetailTabs
|
tab_group_class = ClusterDetailTabs
|
||||||
template_name = 'messagebroker/detail.html'
|
template_name = 'messagebroker/detail.html'
|
||||||
page_title = _("Cluster Details: {{ cluster.name }}")
|
page_title = "Cluster Details: {{ cluster.name }}"
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(DetailView, self).get_context_data(**kwargs)
|
context = super(DetailView, self).get_context_data(**kwargs)
|
||||||
|
|
|
@ -18,7 +18,6 @@ import logging
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.forms import ValidationError
|
from django.forms import ValidationError
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import forms
|
from horizon import forms
|
||||||
from horizon.utils import memoized
|
from horizon.utils import memoized
|
||||||
|
@ -38,12 +37,12 @@ LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
class PasswordMixin(forms.SelfHandlingForm):
|
class PasswordMixin(forms.SelfHandlingForm):
|
||||||
password = forms.RegexField(
|
password = forms.RegexField(
|
||||||
label=_("Password"),
|
label="Password",
|
||||||
widget=forms.PasswordInput(render_value=False),
|
widget=forms.PasswordInput(render_value=False),
|
||||||
regex=validators.password_validator(),
|
regex=validators.password_validator(),
|
||||||
error_messages={'invalid': validators.password_validator_msg()})
|
error_messages={'invalid': validators.password_validator_msg()})
|
||||||
confirm_password = forms.CharField(
|
confirm_password = forms.CharField(
|
||||||
label=_("Confirm Password"),
|
label="Confirm Password",
|
||||||
widget=forms.PasswordInput(render_value=False))
|
widget=forms.PasswordInput(render_value=False))
|
||||||
no_autocomplete = True
|
no_autocomplete = True
|
||||||
|
|
||||||
|
@ -52,33 +51,33 @@ class PasswordMixin(forms.SelfHandlingForm):
|
||||||
data = super(forms.Form, self).clean()
|
data = super(forms.Form, self).clean()
|
||||||
if 'password' in data:
|
if 'password' in data:
|
||||||
if data['password'] != data.get('confirm_password', None):
|
if data['password'] != data.get('confirm_password', None):
|
||||||
raise ValidationError(_('Passwords do not match.'))
|
raise ValidationError('Passwords do not match.')
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
class SetInstanceDetailsAction(workflows.Action):
|
class SetInstanceDetailsAction(workflows.Action):
|
||||||
name = forms.CharField(max_length=80, label=_("Cluster Name"))
|
name = forms.CharField(max_length=80, label="Cluster Name")
|
||||||
flavor = forms.ChoiceField(label=_("Flavor"),
|
flavor = forms.ChoiceField(label="Flavor",
|
||||||
help_text=_("The amount of RAM and CPU included"
|
help_text="The amount of RAM and CPU included"
|
||||||
" in each node of the cluster."))
|
" in each node of the cluster.")
|
||||||
size = forms.IntegerField(label=_("Cluster Size"),
|
size = forms.IntegerField(label="Cluster Size",
|
||||||
min_value=1,
|
min_value=1,
|
||||||
initial=1,
|
initial=1,
|
||||||
help_text=_("The number of nodes that make up "
|
help_text="The number of nodes that make up "
|
||||||
"the cluster."))
|
"the cluster.")
|
||||||
network = forms.ChoiceField(label=_("Network"),
|
network = forms.ChoiceField(label="Network",
|
||||||
help_text=_("Network to attach to the "
|
help_text="Network to attach to the "
|
||||||
"cluster."))
|
"cluster.")
|
||||||
username = forms.CharField(max_length=80, label=_("User Name"),
|
username = forms.CharField(max_length=80, label="User Name",
|
||||||
help_text=_("User name for logging into the "
|
help_text="User name for logging into the "
|
||||||
"RabbitMQ Management UI."))
|
"RabbitMQ Management UI.")
|
||||||
password = forms.RegexField(
|
password = forms.RegexField(
|
||||||
label=_("Password"),
|
label="Password",
|
||||||
widget=forms.PasswordInput(render_value=False),
|
widget=forms.PasswordInput(render_value=False),
|
||||||
regex=validators.password_validator(),
|
regex=validators.password_validator(),
|
||||||
error_messages={'invalid': validators.password_validator_msg()})
|
error_messages={'invalid': validators.password_validator_msg()})
|
||||||
confirm_password = forms.CharField(
|
confirm_password = forms.CharField(
|
||||||
label=_("Confirm Password"),
|
label="Confirm Password",
|
||||||
widget=forms.PasswordInput(render_value=False))
|
widget=forms.PasswordInput(render_value=False))
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
@ -86,11 +85,11 @@ class SetInstanceDetailsAction(workflows.Action):
|
||||||
data = super(forms.Form, self).clean()
|
data = super(forms.Form, self).clean()
|
||||||
if 'password' in data:
|
if 'password' in data:
|
||||||
if data['password'] != data.get('confirm_password', None):
|
if data['password'] != data.get('confirm_password', None):
|
||||||
raise ValidationError(_('Passwords do not match.'))
|
raise ValidationError('Passwords do not match.')
|
||||||
return data
|
return data
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = _("Details")
|
name = "Details"
|
||||||
help_text_template = "messagebroker/_launch_details_help.html"
|
help_text_template = "messagebroker/_launch_details_help.html"
|
||||||
|
|
||||||
@memoized.memoized_method
|
@memoized.memoized_method
|
||||||
|
@ -101,7 +100,7 @@ class SetInstanceDetailsAction(workflows.Action):
|
||||||
LOG.exception("Exception while obtaining flavors list")
|
LOG.exception("Exception while obtaining flavors list")
|
||||||
redirect = reverse("horizon:project:messagebroker:index")
|
redirect = reverse("horizon:project:messagebroker:index")
|
||||||
exceptions.handle(request,
|
exceptions.handle(request,
|
||||||
_('Unable to obtain flavors.'),
|
'Unable to obtain flavors.',
|
||||||
redirect=redirect)
|
redirect=redirect)
|
||||||
|
|
||||||
def populate_flavor_choices(self, request, context):
|
def populate_flavor_choices(self, request, context):
|
||||||
|
@ -120,7 +119,7 @@ class SetInstanceDetailsAction(workflows.Action):
|
||||||
except Exception:
|
except Exception:
|
||||||
network_list = []
|
network_list = []
|
||||||
exceptions.handle(request,
|
exceptions.handle(request,
|
||||||
_('Unable to retrieve networks.'))
|
'Unable to retrieve networks.')
|
||||||
return network_list
|
return network_list
|
||||||
|
|
||||||
def populate_network_choices(self, request, context):
|
def populate_network_choices(self, request, context):
|
||||||
|
@ -135,7 +134,7 @@ class SetInstanceDetailsAction(workflows.Action):
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
exceptions.handle(self.request,
|
exceptions.handle(self.request,
|
||||||
_("Unable to retrieve quota information."))
|
"Unable to retrieve quota information.")
|
||||||
return super(SetInstanceDetailsAction, self).get_help_text(extra)
|
return super(SetInstanceDetailsAction, self).get_help_text(extra)
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,10 +145,10 @@ class SetClusterDetails(workflows.Step):
|
||||||
|
|
||||||
class CreateCluster(workflows.Workflow):
|
class CreateCluster(workflows.Workflow):
|
||||||
slug = "create_cluster"
|
slug = "create_cluster"
|
||||||
name = _("Create Cluster")
|
name = "Create Cluster"
|
||||||
finalize_button_name = _("Create")
|
finalize_button_name = "Create"
|
||||||
success_message = _('Created cluster named "%(name)s".')
|
success_message = 'Created cluster named "%(name)s".'
|
||||||
failure_message = _('Unable to create cluster named "%(name)s".')
|
failure_message = 'Unable to create cluster named "%(name)s".'
|
||||||
success_url = "horizon:project:messagebroker:index"
|
success_url = "horizon:project:messagebroker:index"
|
||||||
default_steps = (SetClusterDetails,)
|
default_steps = (SetClusterDetails,)
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
|
||||||
|
|
||||||
from horizon.test.settings import * # noqa
|
from horizon.test.settings import * # noqa
|
||||||
from horizon.utils import secret_key as secret_key_utils
|
from horizon.utils import secret_key as secret_key_utils
|
||||||
from openstack_dashboard import exceptions
|
from openstack_dashboard import exceptions
|
||||||
|
@ -62,7 +60,7 @@ HORIZON_CONFIG = {
|
||||||
'default_dashboard': 'project',
|
'default_dashboard': 'project',
|
||||||
"password_validator": {
|
"password_validator": {
|
||||||
"regex": '^.{8,18}$',
|
"regex": '^.{8,18}$',
|
||||||
"help_text": _("Password must be between 8 and 18 characters.")
|
"help_text": "Password must be between 8 and 18 characters."
|
||||||
},
|
},
|
||||||
'user_home': None,
|
'user_home': None,
|
||||||
'help_url': "http://docs.openstack.org",
|
'help_url': "http://docs.openstack.org",
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
Django>=1.4,<1.7
|
Django<1.8,>=1.4.2
|
||||||
-e git+https://github.com/openstack/python-cueclient.git#egg=python-cueclient
|
django-openstack-auth>=1.2.0,<2.0.0
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = cuedashboard
|
name = cuedashboard
|
||||||
version = 1
|
|
||||||
summary = Cue Dashboard
|
summary = Cue Dashboard
|
||||||
description-file = README.rst
|
description-file = README.rst
|
||||||
license = Apache Software License
|
license = Apache Software License
|
||||||
|
|
|
@ -10,4 +10,6 @@ django_nose
|
||||||
sphinx>=1.1.2,!=1.2.0,<1.3
|
sphinx>=1.1.2,!=1.2.0,<1.3
|
||||||
oslosphinx>=2.2.0 # Apache-2.0
|
oslosphinx>=2.2.0 # Apache-2.0
|
||||||
|
|
||||||
|
-e git+https://github.com/openstack/python-cueclient.git#egg=python-cueclient
|
||||||
http://tarballs.openstack.org/horizon/horizon-master.tar.gz#egg=horizon
|
http://tarballs.openstack.org/horizon/horizon-master.tar.gz#egg=horizon
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue