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