localized django-openstack views
This commit is contained in:
parent
fcdd0b2888
commit
425652f3be
|
@ -24,6 +24,7 @@ from django.conf import settings
|
|||
from django import template
|
||||
from django import shortcuts
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_openstack import api
|
||||
from django_openstack import forms
|
||||
|
@ -34,8 +35,8 @@ LOG = logging.getLogger('django_openstack.auth')
|
|||
|
||||
|
||||
class Login(forms.SelfHandlingForm):
|
||||
username = forms.CharField(max_length="20", label="User Name")
|
||||
password = forms.CharField(max_length="20", label="Password",
|
||||
username = forms.CharField(max_length="20", label=_("User Name"))
|
||||
password = forms.CharField(max_length="20", label=_("Password"),
|
||||
widget=forms.PasswordInput(render_value=False))
|
||||
|
||||
def handle(self, request, data):
|
||||
|
@ -78,8 +79,9 @@ class Login(forms.SelfHandlingForm):
|
|||
|
||||
# Abort if there are no valid tenants for this user
|
||||
if not tenant:
|
||||
messages.error(request, 'No tenants present for user: %s' %
|
||||
data['username'])
|
||||
messages.error(request,
|
||||
'No tenants present for user: %(user)s' %
|
||||
{"user" : data['username']})
|
||||
return
|
||||
|
||||
# Create a token
|
||||
|
@ -100,12 +102,13 @@ class Login(forms.SelfHandlingForm):
|
|||
return shortcuts.redirect('dash_overview')
|
||||
|
||||
except api_exceptions.Unauthorized as e:
|
||||
msg = 'Error authenticating: %s' % e.message
|
||||
msg = _('Error authenticating: %s') % e.message
|
||||
LOG.exception(msg)
|
||||
messages.error(request, msg)
|
||||
except api_exceptions.ApiException as e:
|
||||
messages.error(request, 'Error authenticating with keystone: %s' %
|
||||
e.message)
|
||||
messages.error(request,
|
||||
_('Error authenticating with keystone: %s') %
|
||||
e.message)
|
||||
|
||||
|
||||
class LoginWithTenant(Login):
|
||||
|
|
|
@ -27,6 +27,7 @@ from django import template
|
|||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django import shortcuts
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_openstack import api
|
||||
from django_openstack import forms
|
||||
|
@ -45,7 +46,7 @@ class DeleteContainer(forms.SelfHandlingForm):
|
|||
api.swift_delete_container(request, data['container_name'])
|
||||
except ContainerNotEmpty, e:
|
||||
messages.error(request,
|
||||
'Unable to delete non-empty container: %s' % \
|
||||
_('Unable to delete non-empty container: %s') %
|
||||
data['container_name'])
|
||||
LOG.exception('Unable to delete container "%s". Exception: "%s"' %
|
||||
(data['container_name'], str(e)))
|
||||
|
@ -61,7 +62,7 @@ class CreateContainer(forms.SelfHandlingForm):
|
|||
|
||||
def handle(self, request, data):
|
||||
api.swift_create_container(request, data['name'])
|
||||
messages.success(request, "Container was successfully created.")
|
||||
messages.success(request, _("Container was successfully created."))
|
||||
return shortcuts.redirect("dash_containers", request.user.tenant_id)
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ from django import template
|
|||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django import shortcuts
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_openstack import api
|
||||
from django_openstack import forms
|
||||
|
@ -43,7 +44,7 @@ class ReleaseFloatingIp(forms.SelfHandlingForm):
|
|||
try:
|
||||
LOG.info('Releasing Floating IP "%s"' % data['floating_ip_id'])
|
||||
api.tenant_floating_ip_release(request, data['floating_ip_id'])
|
||||
messages.info(request, 'Successfully released Floating IP: %s' \
|
||||
messages.info(request, _('Successfully released Floating IP: %s')
|
||||
% data['floating_ip_id'])
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in ReleaseFloatingIp")
|
||||
|
@ -72,10 +73,10 @@ class FloatingIpAssociate(forms.SelfHandlingForm):
|
|||
data['floating_ip_id'])
|
||||
LOG.info('Associating Floating IP "%s" with Instance "%s"'
|
||||
% (data['floating_ip'], data['instance_id']))
|
||||
messages.info(request, 'Successfully associated Floating IP: %s \
|
||||
with Instance: %s'
|
||||
% (data['floating_ip'],
|
||||
data['instance_id']))
|
||||
messages.info(request, _('Successfully associated Floating IP: \
|
||||
%(ip)s with Instance: %(inst)s'
|
||||
% {"ip": data['floating_ip'],
|
||||
"inst": data['instance_id']}))
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in FloatingIpAssociate")
|
||||
messages.error(request, 'Error associating Floating IP: %s'
|
||||
|
@ -94,11 +95,12 @@ class FloatingIpDisassociate(forms.SelfHandlingForm):
|
|||
LOG.info('Disassociating Floating IP "%s"'
|
||||
% data['floating_ip_id'])
|
||||
|
||||
messages.info(request, 'Successfully disassociated Floating IP: %s'
|
||||
% data['floating_ip_id'])
|
||||
messages.info(request,
|
||||
_('Successfully disassociated Floating IP: %s')
|
||||
% data['floating_ip_id'])
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in FloatingIpAssociate")
|
||||
messages.error(request, 'Error disassociating Floating IP: %s'
|
||||
messages.error(request, _('Error disassociating Floating IP: %s')
|
||||
% e.message)
|
||||
return shortcuts.redirect('dash_floating_ips', request.user.tenant_id)
|
||||
|
||||
|
@ -112,8 +114,10 @@ class FloatingIpAllocate(forms.SelfHandlingForm):
|
|||
LOG.info('Allocating Floating IP "%s" to tenant "%s"'
|
||||
% (fip.ip, data['tenant_id']))
|
||||
|
||||
messages.success(request, 'Successfully allocated Floating IP "%s"\
|
||||
to tenant "%s"' % (fip.ip, data['tenant_id']))
|
||||
messages.success(request,
|
||||
_('Successfully allocated Floating IP "%(ip)s"\
|
||||
to tenant "%(tenant)s"')
|
||||
% {"ip": fip.ip, "tenant": data['tenant_id']})
|
||||
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in FloatingIpAllocate")
|
||||
|
@ -134,7 +138,8 @@ def index(request, tenant_id):
|
|||
except novaclient_exceptions.ClientException, e:
|
||||
floating_ips = []
|
||||
LOG.exception("ClientException in floating ip index")
|
||||
messages.error(request, 'Error fetching floating ips: %s' % e.message)
|
||||
messages.error(request,
|
||||
_('Error fetching floating ips: %s') % e.message)
|
||||
|
||||
return shortcuts.render_to_response(
|
||||
'django_openstack/dash/floating_ips/index.html', {
|
||||
|
|
|
@ -56,7 +56,8 @@ class UpdateImageForm(forms.SelfHandlingForm):
|
|||
def handle(self, request, data):
|
||||
image_id = data['image_id']
|
||||
tenant_id = request.user.tenant_id
|
||||
error_retrieving = _('Unable to retreive image info from glance: %s' % image_id)
|
||||
error_retrieving = _('Unable to retreive image info from glance: %s'
|
||||
% image_id)
|
||||
error_updating = _('Error updating image with id: %s' % image_id)
|
||||
|
||||
try:
|
||||
|
|
|
@ -55,10 +55,10 @@ class TerminateInstance(forms.SelfHandlingForm):
|
|||
LOG.exception('ApiException while terminating instance "%s"' %
|
||||
instance_id)
|
||||
messages.error(request,
|
||||
'Unable to terminate %s: %s' %
|
||||
(instance_id, e.message,))
|
||||
_('Unable to terminate %(inst)s: %(message)s') %
|
||||
{"inst": instance_id, "message": e.message})
|
||||
else:
|
||||
msg = 'Instance %s has been terminated.' % instance_id
|
||||
msg = _('Instance %s has been terminated.') % instance_id
|
||||
LOG.info(msg)
|
||||
messages.success(request, msg)
|
||||
|
||||
|
@ -77,10 +77,10 @@ class RebootInstance(forms.SelfHandlingForm):
|
|||
LOG.exception('ApiException while rebooting instance "%s"' %
|
||||
instance_id)
|
||||
messages.error(request,
|
||||
'Unable to reboot instance: %s' % e.message)
|
||||
_('Unable to reboot instance: %s') % e.message)
|
||||
|
||||
else:
|
||||
msg = 'Instance %s has been rebooted.' % instance_id
|
||||
msg = _('Instance %s has been rebooted.') % instance_id
|
||||
LOG.info(msg)
|
||||
messages.success(request, msg)
|
||||
|
||||
|
@ -105,7 +105,7 @@ class UpdateInstance(forms.SelfHandlingForm):
|
|||
messages.success(request, "Instance '%s' updated" % data['name'])
|
||||
except api_exceptions.ApiException, e:
|
||||
messages.error(request,
|
||||
'Unable to update instance: %s' % e.message)
|
||||
_('Unable to update instance: %s') % e.message)
|
||||
|
||||
return shortcuts.redirect('dash_instances', tenant_id)
|
||||
|
||||
|
@ -121,7 +121,8 @@ def index(request, tenant_id):
|
|||
instances = api.server_list(request)
|
||||
except api_exceptions.ApiException as e:
|
||||
LOG.exception('Exception in instance index')
|
||||
messages.error(request, 'Unable to get instance list: %s' % e.message)
|
||||
messages.error(request,
|
||||
_('Unable to get instance list: %s') % e.message)
|
||||
|
||||
# We don't have any way of showing errors for these, so don't bother
|
||||
# trying to reuse the forms from above
|
||||
|
@ -142,7 +143,8 @@ def refresh(request, tenant_id):
|
|||
try:
|
||||
instances = api.server_list(request)
|
||||
except Exception as e:
|
||||
messages.error(request, 'Unable to get instance list: %s' % e.message)
|
||||
messages.error(request,
|
||||
_('Unable to get instance list: %s') % e.message)
|
||||
|
||||
# We don't have any way of showing errors for these, so don't bother
|
||||
# trying to reuse the forms from above
|
||||
|
@ -175,7 +177,7 @@ def usage(request, tenant_id=None):
|
|||
except api_exceptions.ApiException, e:
|
||||
LOG.exception('ApiException in instance usage')
|
||||
|
||||
messages.error(request, 'Unable to get usage info: %s' % e.message)
|
||||
messages.error(request, _('Unable to get usage info: %s') % e.message)
|
||||
|
||||
ram_unit = "MB"
|
||||
total_ram = 0
|
||||
|
@ -248,8 +250,8 @@ def vnc(request, tenant_id, instance_id):
|
|||
except api_exceptions.ApiException, e:
|
||||
LOG.exception('ApiException while fetching instance vnc connection')
|
||||
messages.error(request,
|
||||
'Unable to get vnc console for instance %s: %s' %
|
||||
(instance_id, e.message))
|
||||
_('Unable to get vnc console for instance %(inst)s: %(message)s') %
|
||||
{"inst": instance_id, "massage": e.message})
|
||||
return shortcuts.redirect('dash_instances', tenant_id)
|
||||
|
||||
|
||||
|
@ -260,8 +262,8 @@ def update(request, tenant_id, instance_id):
|
|||
except api_exceptions.ApiException, e:
|
||||
LOG.exception('ApiException while fetching instance info')
|
||||
messages.error(request,
|
||||
'Unable to get information for instance %s: %s' %
|
||||
(instance_id, e.message))
|
||||
_('Unable to get information for instance %(inst)s: %(message)s') %
|
||||
{"inst": instance_id, "massage": e.message})
|
||||
return shortcuts.redirect('dash_instances', tenant_id)
|
||||
|
||||
form, handled = UpdateInstance.maybe_handle(request, initial={
|
||||
|
|
|
@ -29,6 +29,7 @@ from django.contrib import messages
|
|||
from django.contrib.auth.decorators import login_required
|
||||
from django.core import validators
|
||||
from django.shortcuts import redirect, render_to_response
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_openstack import api
|
||||
from django_openstack import forms
|
||||
|
@ -45,11 +46,11 @@ class DeleteKeypair(forms.SelfHandlingForm):
|
|||
try:
|
||||
LOG.info('Deleting keypair "%s"' % data['keypair_id'])
|
||||
api.keypair_delete(request, data['keypair_id'])
|
||||
messages.info(request, 'Successfully deleted keypair: %s' \
|
||||
messages.info(request, _('Successfully deleted keypair: %s')
|
||||
% data['keypair_id'])
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in DeleteKeypair")
|
||||
messages.error(request, 'Error deleting keypair: %s' % e.message)
|
||||
messages.error(request, _('Error deleting keypair: %s') % e.message)
|
||||
return redirect(request.build_absolute_uri())
|
||||
|
||||
|
||||
|
@ -69,7 +70,7 @@ class CreateKeypair(forms.SelfHandlingForm):
|
|||
return response
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in CreateKeyPair")
|
||||
messages.error(request, 'Error Creating Keypair: %s' % e.message)
|
||||
messages.error(request, _('Error Creating Keypair: %s') % e.message)
|
||||
return redirect(request.build_absolute_uri())
|
||||
|
||||
|
||||
|
@ -83,12 +84,13 @@ class ImportKeypair(forms.SelfHandlingForm):
|
|||
try:
|
||||
LOG.info('Importing keypair "%s"' % data['name'])
|
||||
api.keypair_import(request, data['name'], data['public_key'])
|
||||
messages.success(request, 'Successfully imported public key: %s'
|
||||
messages.success(request, _('Successfully imported public key: %s')
|
||||
% data['name'])
|
||||
return redirect('dash_keypairs', request.user.tenant_id)
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in ImportKeypair")
|
||||
messages.error(request, 'Error Importing Keypair: %s' % e.message)
|
||||
messages.error(request,
|
||||
_('Error Importing Keypair: %s') % e.message)
|
||||
return redirect(request.build_absolute_uri())
|
||||
|
||||
|
||||
|
@ -104,7 +106,7 @@ def index(request, tenant_id):
|
|||
except novaclient_exceptions.ClientException, e:
|
||||
keypairs = []
|
||||
LOG.exception("ClientException in keypair index")
|
||||
messages.error(request, 'Error fetching keypairs: %s' % e.message)
|
||||
messages.error(request, _('Error fetching keypairs: %s') % e.message)
|
||||
|
||||
return render_to_response('django_openstack/dash/keypairs/index.html', {
|
||||
'keypairs': keypairs,
|
||||
|
|
|
@ -57,11 +57,11 @@ class CreateNetwork(forms.SelfHandlingForm):
|
|||
api.quantum_create_network(request, send_data)
|
||||
except Exception, e:
|
||||
messages.error(request,
|
||||
'Unable to create network %s: %s' %
|
||||
(network_name, e.message,))
|
||||
_('Unable to create network %(network)s: %(msg)s') %
|
||||
{"network": network_name, "msg": e.message})
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
else:
|
||||
msg = 'Network %s has been created.' % network_name
|
||||
msg = _('Network %s has been created.') % network_name
|
||||
LOG.info(msg)
|
||||
messages.success(request, msg)
|
||||
return shortcuts.redirect('dash_networks',
|
||||
|
@ -77,8 +77,8 @@ class DeleteNetwork(forms.SelfHandlingForm):
|
|||
api.quantum_delete_network(request, data['network'])
|
||||
except Exception, e:
|
||||
messages.error(request,
|
||||
'Unable to delete network %s: %s' %
|
||||
(data['network'], e.message,))
|
||||
_('Unable to delete network %(network)s: %(msg)s') %
|
||||
{"network": data['network'], "msg": e.message})
|
||||
else:
|
||||
msg = 'Network %s has been deleted.' % data['network']
|
||||
LOG.info(msg)
|
||||
|
@ -99,11 +99,11 @@ class RenameNetwork(forms.SelfHandlingForm):
|
|||
api.quantum_update_network(request, data['network'], send_data)
|
||||
except Exception, e:
|
||||
messages.error(request,
|
||||
'Unable to rename network %s: %s' %
|
||||
(data['network'], e.message,))
|
||||
_('Unable to rename network %(network)s: %(msg)s') %
|
||||
{"network": data['network'], "msg": e.message})
|
||||
else:
|
||||
msg = 'Network %s has been renamed to %s.' % \
|
||||
(data['network'], data['new_name'])
|
||||
msg = _('Network %(network)s has been renamed to %(new_name)s.') %{
|
||||
"network": data['network'], "new_name": data['new_name']}
|
||||
LOG.info(msg)
|
||||
messages.success(request, msg)
|
||||
|
||||
|
@ -134,7 +134,7 @@ def index(request, tenant_id):
|
|||
})
|
||||
|
||||
except Exception, e:
|
||||
messages.error(request, 'Unable to get network list: %s' % e.message)
|
||||
messages.error(request, _('Unable to get network list: %s') % e.message)
|
||||
|
||||
return shortcuts.render_to_response(
|
||||
'django_openstack/dash/networks/index.html', {
|
||||
|
@ -169,7 +169,8 @@ def detail(request, tenant_id, network_id):
|
|||
network['id'] = network_id
|
||||
network['ports'] = _get_port_states(request, tenant_id, network_id)
|
||||
except Exception, e:
|
||||
messages.error(request, 'Unable to get network details:%s' % e.message)
|
||||
messages.error(request,
|
||||
_('Unable to get network details: %s') % e.message)
|
||||
|
||||
return shortcuts.render_to_response(
|
||||
'django_openstack/dash/networks/detail.html', {
|
||||
|
|
|
@ -29,6 +29,7 @@ from django.contrib import messages
|
|||
from django.contrib.auth.decorators import login_required
|
||||
from django import shortcuts
|
||||
from django.shortcuts import render_to_response
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_openstack import api
|
||||
from django_openstack import forms
|
||||
|
@ -50,7 +51,7 @@ class FilterObjects(forms.SelfHandlingForm):
|
|||
|
||||
if not objects:
|
||||
messages.info(request,
|
||||
'There are no objects matching that prefix in %s' %
|
||||
_('There are no objects matching that prefix in %s') %
|
||||
data['container_name'])
|
||||
|
||||
return objects
|
||||
|
@ -66,7 +67,7 @@ class DeleteObject(forms.SelfHandlingForm):
|
|||
data['container_name'],
|
||||
data['object_name'])
|
||||
messages.info(request,
|
||||
'Successfully deleted object: %s' % \
|
||||
_('Successfully deleted object: %s') %
|
||||
data['object_name'])
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
|
||||
|
@ -83,7 +84,7 @@ class UploadObject(forms.SelfHandlingForm):
|
|||
data['name'],
|
||||
self.files['object_file'].read())
|
||||
|
||||
messages.success(request, "Object was successfully uploaded.")
|
||||
messages.success(request, _("Object was successfully uploaded."))
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
|
||||
|
||||
|
@ -114,8 +115,8 @@ class CopyObject(forms.SelfHandlingForm):
|
|||
new_object_name)
|
||||
|
||||
messages.success(request,
|
||||
'Object was successfully copied to %s\%s' %
|
||||
(new_container_name, new_object_name))
|
||||
_('Object was successfully copied to %(container)s\%(obj)s') %
|
||||
{"container": new_container_name, "obj": new_object_name})
|
||||
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
|
||||
|
|
|
@ -50,11 +50,11 @@ class CreatePort(forms.SelfHandlingForm):
|
|||
api.quantum_create_port(request, data['network'])
|
||||
except Exception, e:
|
||||
messages.error(request,
|
||||
'Unable to create ports on network %s: %s' %
|
||||
(data['network'], e.message))
|
||||
_('Unable to create ports on network %(network)s: %(msg)s') %
|
||||
{"network": data['network'], "msg": e.message})
|
||||
else:
|
||||
msg = '%s ports created on network %s.' % \
|
||||
(data['ports_num'], data['network'])
|
||||
msg = _('%(num_ports)s ports created on network %(network)s.') % {
|
||||
"num_ports": data['ports_num'], "network": data['network']}
|
||||
LOG.info(msg)
|
||||
messages.success(request, msg)
|
||||
|
||||
|
@ -72,11 +72,11 @@ class DeletePort(forms.SelfHandlingForm):
|
|||
api.quantum_delete_port(request, data['network'], data['port'])
|
||||
except Exception, e:
|
||||
messages.error(request,
|
||||
'Unable to delete port %s: %s' %
|
||||
(data['port'], e.message,))
|
||||
_('Unable to delete port %(port)s: %(msg)s') %
|
||||
{"port": data['port'], "msg": e.message})
|
||||
else:
|
||||
msg = 'Port %s deleted from network %s.' % \
|
||||
(data['port'], data['network'])
|
||||
msg = _('Port %(port)s deleted from network %(network)s.') % {
|
||||
"port": data['port'], "network": data['network']}
|
||||
LOG.info(msg)
|
||||
messages.success(request, msg)
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
|
|
|
@ -53,13 +53,13 @@ class CreateGroup(forms.SelfHandlingForm):
|
|||
security_group = api.security_group_create(request,
|
||||
data['name'],
|
||||
data['description'])
|
||||
messages.info(request, 'Successfully created security_group: %s' \
|
||||
messages.info(request, _('Successfully created security_group: %s')
|
||||
% data['name'])
|
||||
return shortcuts.redirect('dash_security_groups',
|
||||
data['tenant_id'])
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in CreateGroup")
|
||||
messages.error(request, 'Error creating security group: %s' %
|
||||
messages.error(request, _('Error creating security group: %s') %
|
||||
e.message)
|
||||
|
||||
|
||||
|
@ -73,11 +73,11 @@ class DeleteGroup(forms.SelfHandlingForm):
|
|||
|
||||
security_group = api.security_group_delete(request,
|
||||
data['security_group_id'])
|
||||
messages.info(request, 'Successfully deleted security_group: %s' \
|
||||
messages.info(request, _('Successfully deleted security_group: %s')
|
||||
% data['security_group_id'])
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in DeleteGroup")
|
||||
messages.error(request, 'Error deleting security group: %s'
|
||||
messages.error(request, _('Error deleting security group: %s')
|
||||
% e.message)
|
||||
return shortcuts.redirect('dash_security_groups', data['tenant_id'])
|
||||
|
||||
|
@ -110,7 +110,7 @@ class AddRule(forms.SelfHandlingForm):
|
|||
% rule.id)
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in AddRule")
|
||||
messages.error(request, 'Error adding rule security group: %s'
|
||||
messages.error(request, _('Error adding rule security group: %s')
|
||||
% e.message)
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
|
||||
|
@ -128,11 +128,11 @@ class DeleteRule(forms.SelfHandlingForm):
|
|||
security_group = api.security_group_rule_delete(
|
||||
request,
|
||||
security_group_rule_id)
|
||||
messages.info(request, 'Successfully deleted rule: %s' \
|
||||
messages.info(request, _('Successfully deleted rule: %s')
|
||||
% security_group_rule_id)
|
||||
except novaclient_exceptions.ClientException, e:
|
||||
LOG.exception("ClientException in DeleteRule")
|
||||
messages.error(request, 'Error authorizing security group: %s'
|
||||
messages.error(request, _('Error authorizing security group: %s')
|
||||
% e.message)
|
||||
return shortcuts.redirect(request.build_absolute_uri())
|
||||
|
||||
|
@ -150,7 +150,7 @@ def index(request, tenant_id):
|
|||
except novaclient_exceptions.ClientException, e:
|
||||
security_groups = []
|
||||
LOG.exception("ClientException in security_groups index")
|
||||
messages.error(request, 'Error fetching security_groups: %s'
|
||||
messages.error(request, _('Error fetching security_groups: %s')
|
||||
% e.message)
|
||||
|
||||
return shortcuts.render_to_response(
|
||||
|
|
|
@ -58,8 +58,9 @@ class CreateSnapshot(forms.SelfHandlingForm):
|
|||
data['name'])
|
||||
instance = api.server_get(request, data['instance_id'])
|
||||
|
||||
messages.info(request, 'Snapshot "%s" created for instance "%s"' %\
|
||||
(data['name'], instance.name))
|
||||
messages.info(request,
|
||||
_('Snapshot "%(name)s" created for instance "%(inst)s"') %
|
||||
{"name": data['name'], "inst": instance.name})
|
||||
return shortcuts.redirect('dash_snapshots', data['tenant_id'])
|
||||
except api_exceptions.ApiException, e:
|
||||
msg = 'Error Creating Snapshot: %s' % e.message
|
||||
|
@ -75,11 +76,11 @@ def index(request, tenant_id):
|
|||
try:
|
||||
images = api.snapshot_list_detailed(request)
|
||||
except glance_exception.ClientConnectionError, e:
|
||||
msg = 'Error connecting to glance: %s' % str(e)
|
||||
msg = _('Error connecting to glance: %s') % str(e)
|
||||
LOG.exception(msg)
|
||||
messages.error(request, msg)
|
||||
except glance_exception.Error, e:
|
||||
msg = 'Error retrieving image list: %s' % str(e)
|
||||
msg = _('Error retrieving image list: %s') % str(e)
|
||||
LOG.exception(msg)
|
||||
messages.error(request, msg)
|
||||
|
||||
|
@ -107,8 +108,8 @@ def create(request, tenant_id, instance_id):
|
|||
|
||||
valid_states = ['ACTIVE']
|
||||
if instance.status not in valid_states:
|
||||
messages.error(request, "To snapshot, instance state must be\
|
||||
one of the following: %s" %
|
||||
messages.error(request, _("To snapshot, instance state must be\
|
||||
one of the following: %s") %
|
||||
', '.join(valid_states))
|
||||
return shortcuts.redirect('dash_instances', tenant_id)
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,531 +0,0 @@
|
|||
# Translations of Dashboard for OpenStack User Interface.
|
||||
# Copyright 2011 Midokura KK
|
||||
# This file is distributed under the same license as the Dashboard for OpenStack.
|
||||
# FIRST AUTHOR Jeffrey Wilcox, 2011.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openstack-dashboard\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-06-08 14:01+0900\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: management/commands/createnovausers.py:31
|
||||
msgid "Creates nova users for all users in the django auth database."
|
||||
msgstr ""
|
||||
|
||||
#: management/commands/createnovausers.py:38
|
||||
#, python-format
|
||||
msgid "creating user %s... "
|
||||
msgstr ""
|
||||
|
||||
#: nova/forms.py:64 nova/forms.py:78
|
||||
msgid "none available"
|
||||
msgstr ""
|
||||
|
||||
#: nova/forms.py:182
|
||||
#, python-format
|
||||
msgid "A key named %s already exists."
|
||||
msgstr ""
|
||||
|
||||
#: nova/forms.py:196
|
||||
#, python-format
|
||||
msgid "A security group named %s already exists."
|
||||
msgstr ""
|
||||
|
||||
#: nova/shortcuts.py:43
|
||||
msgid "User not authenticated"
|
||||
msgstr ""
|
||||
|
||||
#: nova/shortcuts.py:50
|
||||
#, python-format
|
||||
msgid "Project %s does not exist."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/admin.py:96
|
||||
#, python-format
|
||||
msgid "Successfully started VPN for project %(proj)s."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/admin.py:100
|
||||
#, python-format
|
||||
msgid "Unable to start VPN for the project %(proj)s: %(code)s - %(msg)s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/admin.py:140
|
||||
#, python-format
|
||||
msgid "Successfully modified the project %(proj)s."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/admin.py:145
|
||||
#, python-format
|
||||
msgid "Unable modify the project %(proj)s: %(code)s - %(msg)s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:94
|
||||
#, python-format
|
||||
msgid "Unable to launch: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:106
|
||||
#, python-format
|
||||
msgid "Instance %s launched."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:157
|
||||
#, python-format
|
||||
msgid "Unable to deregister image: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:163
|
||||
#, python-format
|
||||
msgid "Image %s has been successfully deregistered."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:188
|
||||
#, python-format
|
||||
msgid "Unable to make image private: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:202
|
||||
#, python-format
|
||||
msgid "Unable to make image public: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:228
|
||||
#, python-format
|
||||
msgid "Unable to update image: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/images.py:231
|
||||
#, python-format
|
||||
msgid "Image %s has been updated."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/instances.py:145
|
||||
#, python-format
|
||||
msgid "Unable to terminate %(inst)s: %(msg)s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/instances.py:156
|
||||
#, python-format
|
||||
msgid "Instance %(inst)s has been terminated."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/instances.py:220
|
||||
#, python-format
|
||||
msgid "Unable to update instance %(inst)s: %(msg)s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/instances.py:232
|
||||
#, python-format
|
||||
msgid "Instance %(inst)s has been updated."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/keypairs.py:67
|
||||
#, python-format
|
||||
msgid "Unable to create key: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/keypairs.py:112
|
||||
#, python-format
|
||||
msgid "Unable to delete key: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/keypairs.py:117
|
||||
#, python-format
|
||||
msgid "Key %s has been successfully deleted."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/regions.py:39
|
||||
#, python-format
|
||||
msgid "You are now using the region \"%s\"."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:85
|
||||
#, python-format
|
||||
msgid "Unable to create security group: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:92
|
||||
#, python-format
|
||||
msgid "Security Group %s has been succesfully created."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:125
|
||||
#, python-format
|
||||
msgid "Unable to authorize: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:136
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Security Group %(grp)s: Access to %(proto)s ports %(fr)d - %(to)d has been "
|
||||
"authorized."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:177
|
||||
#, python-format
|
||||
msgid "Unable to revoke: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:186
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Security Group %(grp)s: Access to %(proto)s ports %(fr)d - %(to)d has been "
|
||||
"revoked."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:210
|
||||
#, python-format
|
||||
msgid "Unable to delete security group: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/securitygroups.py:215
|
||||
#, python-format
|
||||
msgid "Security Group %s was successfully deleted."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:69
|
||||
#, python-format
|
||||
msgid "Unable to create volume: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:77
|
||||
#, python-format
|
||||
msgid "Volume %(id)s %(name)s has been successfully created."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:108
|
||||
#, python-format
|
||||
msgid "Unable to delete volume: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:114
|
||||
#, python-format
|
||||
msgid "Volume %s has been successfully deleted."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:138
|
||||
#, python-format
|
||||
msgid "Unable to attach volume: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:145
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Volume %s is scheduled to be attached. If it doesn't become attached in two "
|
||||
"minutes, please try again (you may need to specify a different device)."
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:179
|
||||
#, python-format
|
||||
msgid "Unable to detach volume: %s"
|
||||
msgstr ""
|
||||
|
||||
#: nova/views/volumes.py:185
|
||||
#, python-format
|
||||
msgid "Volume %s has been successfully detached."
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/delete_project.html:13
|
||||
msgid "Delete Project"
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/delete_project.html:14
|
||||
msgid "Do you really want to delete this project?<"
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/delete_project_user.html:8
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/delete_project_user.html:13
|
||||
#: templates/admin/django_openstack/nova/project/project_user.html:67
|
||||
msgid "Remove User From Project"
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/delete_project_user.html:14
|
||||
msgid "Do you really want to remove this user from project?"
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/send_credentials.html:46
|
||||
#: templates/admin/django_openstack/nova/project/send_credentials.html:81
|
||||
msgid "Send Credentials"
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/send_credentials.html:47
|
||||
#, python-format
|
||||
msgid ""
|
||||
"\"Select which users you would like to send credentials to from the "
|
||||
"'%(proj)s' project.\""
|
||||
msgstr ""
|
||||
|
||||
#: templates/admin/django_openstack/nova/project/send_credentials.html:49
|
||||
msgid "Credentials sent successfully"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/credentials/expired.html:6
|
||||
msgid "Expired Token"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/credentials/expired.html:10
|
||||
msgid "The link you clicked has expired."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/credentials/expired.html:12
|
||||
#, python-format
|
||||
msgid ""
|
||||
"This credentials download link you have reached\n"
|
||||
" is either invalid or has expired. Each link is only good for one use. "
|
||||
"If\n"
|
||||
" you need to download your credentials again, please contact the\n"
|
||||
" %(brand)s support team."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/_list.html:70
|
||||
msgid "Make Private"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/_list.html:72
|
||||
msgid "Make Public"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/_list.html:80
|
||||
msgid "Remove Image"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/_list.html:110
|
||||
msgid "No images currently available."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/edit.html:13
|
||||
msgid "Edit Image"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/edit.html:14
|
||||
msgid ""
|
||||
"From this page you can edit the name and description of an image that "
|
||||
"belongs to you."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/edit.html:18
|
||||
msgid "Edit Image:"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/edit.html:29
|
||||
msgid "Update Image"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/index.html:4
|
||||
msgid "Launch an Image"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/index.html:14
|
||||
msgid "Images"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/index.html:15
|
||||
msgid ""
|
||||
"Images are snapshots of running systems which can easily be deployed to run "
|
||||
"one or more instances."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/launch.html:13
|
||||
#: templates/django_openstack/nova/images/launch.html:21
|
||||
msgid "Launch Image"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/launch.html:14
|
||||
msgid ""
|
||||
"You can launch up to five instances of an image at a time. Some images allow "
|
||||
"for custom configuration to be passed in via User data."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/images/launch.html:23
|
||||
msgid "Location"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/_instances_list.html:102
|
||||
msgid ""
|
||||
"No instances are currently running. You may start a new instance from the"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/detail_list.html:10
|
||||
msgid "Instance ID:"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/detail_list.html:11
|
||||
msgid "Here you can see up to the minute performance data about your instance."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/detail_list.html:18
|
||||
#: templates/django_openstack/nova/instances/edit.html:18
|
||||
msgid "Edit Instance:"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/detail_list.html:29
|
||||
#: templates/django_openstack/nova/instances/edit.html:29
|
||||
msgid "Update Instance"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/edit.html:13
|
||||
msgid "Edit Instance"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/edit.html:14
|
||||
msgid ""
|
||||
"From this page you can give your instance an alias, so you don't have to "
|
||||
"remember its unique id."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/index.html:11
|
||||
msgid "Instances"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/index.html:12
|
||||
msgid ""
|
||||
"Instances are virtual servers launched from images. You can launch instances "
|
||||
"from the"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/index.html:22
|
||||
msgid "Are you sure you wish to terminate instance"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/index.html:26
|
||||
msgid ""
|
||||
"A connection error has occurred. Please ensure you are still connected to "
|
||||
"VPN."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/instances/performance.html:10
|
||||
#, python-format
|
||||
msgid "Instance ID: %(instance.id)s Performance\" "
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/keypairs/_list.html:28
|
||||
msgid "No key pairs currently exist."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/keypairs/index.html:13
|
||||
msgid "Keys"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/keypairs/index.html:14
|
||||
msgid ""
|
||||
"Key pairs are ssh credentials which are injected into images when they are "
|
||||
"launched. Creating a new key pair registers the public key and downloads the "
|
||||
"private key (a pem file). <em>Protect and use the key as a normal private "
|
||||
"key.</em>"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/keypairs/index.html:36
|
||||
msgid "Are you sure you wish to delete key"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/edit_user.html:24
|
||||
msgid "Edit User Roles"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/edit_user.html:25
|
||||
msgid "From here you can edit multiple user roles."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/edit_user.html:35
|
||||
msgid "Edit Roles for User:"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/edit_user.html:67
|
||||
#: templates/django_openstack/nova/projects/manage.html:39
|
||||
msgid "No users are currently associated with this project."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/index.html:14
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Welcome to the <span>%(proj)s</span> Overview. From here you can manage "
|
||||
"your instances, images, keys, and security groups."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/index.html:15
|
||||
msgid ""
|
||||
"To get started using the command line management tools, you can <a target="
|
||||
"\"_blank\" href=\"http://open.eucalyptus.com/wiki/"
|
||||
"Euca2oolsGuide_v1.1\">download euca2ools</a> and use them with your x509 "
|
||||
"credentials."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/index.html:21
|
||||
msgid "Generate X509 credentials."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/index.html:22
|
||||
msgid "View Instances"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/index.html:23
|
||||
msgid "View Images."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/manage.html:8
|
||||
msgid "Manage Users and Roles"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/projects/manage.html:9
|
||||
msgid "From here you can manage users and roles."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/securitygroups/detail.html:19
|
||||
#, python-format
|
||||
msgid " Security Group: %(securitygroup.name)s "
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/securitygroups/detail.html:20
|
||||
msgid ""
|
||||
"Add and remove protocols to the security group by authorizing and revoking "
|
||||
"port forwarding. For instance<br /> [tcp, 80, 80] will allow access to HTTP "
|
||||
"from devices outside this security group."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/securitygroups/index.html:19
|
||||
msgid "Security Groups"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/securitygroups/index.html:20
|
||||
msgid ""
|
||||
"Security groups are firewall rules which allow access to your instances from "
|
||||
"other groups as well as the internet. All ports/protocols are denied by "
|
||||
"default."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/volumes/index.html:8
|
||||
msgid "Volumes"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/volumes/index.html:9
|
||||
msgid ""
|
||||
"Volumes provide persistent block storage. Creating a new volume gives you a "
|
||||
"raw block device which you may format with your choice of filesystems (ext3 "
|
||||
"is recommended). A volume may only be attached to a single instance at a "
|
||||
"time."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/volumes/index.html:59
|
||||
msgid "No volumes currently exist."
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/volumes/index.html:68
|
||||
msgid "Create New Volume"
|
||||
msgstr ""
|
||||
|
||||
#: templates/django_openstack/nova/volumes/index.html:79
|
||||
msgid "Attach Volume"
|
||||
msgstr ""
|
Loading…
Reference in New Issue