Use oslo.i18n
oslo.i18n provides the i18n functions that were provided by oslo-incubator's gettextutils module. Some tests that were using internal details of the library were removed. Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
This commit is contained in:
parent
ff756a0184
commit
826aed0ec7
@ -21,4 +21,4 @@ in nova/tests/test_localization.py.
|
||||
|
||||
The ``_()`` function is found by doing::
|
||||
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
@ -21,7 +21,7 @@ import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from nova import context
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common.middleware import request_id
|
||||
|
@ -32,8 +32,8 @@ from nova.api.ec2 import faults
|
||||
from nova.api import validator
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common.gettextutils import _LE
|
||||
from nova.i18n import _
|
||||
from nova.i18n import _LE
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
|
@ -38,12 +38,12 @@ from nova.compute import api as compute_api
|
||||
from nova.compute import vm_states
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.image import s3
|
||||
from nova import network
|
||||
from nova.network.security_group import neutron_driver
|
||||
from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import timeutils
|
||||
from nova import quota
|
||||
|
@ -21,10 +21,10 @@ from nova import availability_zones
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.network import model as network_model
|
||||
from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import memorycache
|
||||
from nova.openstack.common import timeutils
|
||||
|
@ -27,7 +27,7 @@ import webob.exc
|
||||
from nova.api.metadata import base
|
||||
from nova import conductor
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import memorycache
|
||||
from nova import utils
|
||||
|
@ -16,8 +16,8 @@
|
||||
from webob import exc
|
||||
|
||||
from nova import context
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ import errno
|
||||
from oslo.config import cfg
|
||||
|
||||
from nova.api.metadata import base
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
@ -27,9 +27,9 @@ import webob.exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.i18n import translate
|
||||
from nova import notifications
|
||||
from nova.openstack.common import gettextutils
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
from nova import wsgi as base_wsgi
|
||||
@ -107,12 +107,8 @@ class FaultWrapper(base_wsgi.Middleware):
|
||||
# inconsistent with the EC2 API to hide every exception,
|
||||
# including those that are safe to expose, see bug 1021373
|
||||
if safe:
|
||||
if isinstance(inner.msg_fmt, gettextutils.Message):
|
||||
user_locale = req.best_match_language()
|
||||
inner_msg = gettextutils.translate(
|
||||
inner.msg_fmt, user_locale)
|
||||
else:
|
||||
inner_msg = unicode(inner)
|
||||
user_locale = req.best_match_language()
|
||||
inner_msg = translate(inner.message, user_locale)
|
||||
outer.explanation = '%s: %s' % (inner.__class__.__name__,
|
||||
inner_msg)
|
||||
|
||||
|
@ -29,7 +29,7 @@ from nova.compute import task_states
|
||||
from nova.compute import utils as compute_utils
|
||||
from nova.compute import vm_states
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import quota
|
||||
|
||||
|
@ -24,7 +24,7 @@ from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova.compute import vm_states
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
|
||||
|
@ -22,7 +22,7 @@ from webob import exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
|
||||
|
@ -19,7 +19,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
@ -21,8 +21,8 @@ from webob import exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.virt.baremetal import db
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'baremetal_nodes')
|
||||
|
@ -28,7 +28,7 @@ from nova.api.openstack import xmlutil
|
||||
from nova.cells import rpcapi as cells_rpcapi
|
||||
from nova.compute import api as compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova.openstack.common import timeutils
|
||||
|
@ -18,7 +18,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
import nova.cert.rpcapi
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'certificates')
|
||||
|
||||
|
@ -25,9 +25,9 @@ from nova import compute
|
||||
from nova.compute import utils as compute_utils
|
||||
from nova.compute import vm_states
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common import fileutils
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import timeutils
|
||||
from nova import utils
|
||||
|
||||
|
@ -17,8 +17,8 @@ import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'cloudpipe_update')
|
||||
|
||||
|
@ -18,7 +18,7 @@ import webob
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.consoleauth import rpcapi as consoleauth_rpcapi
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'console_auth_tokens')
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'console_output')
|
||||
|
@ -18,7 +18,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'consoles')
|
||||
|
@ -19,7 +19,7 @@ from webob import exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import strutils
|
||||
|
||||
ALIAS = 'OS-DCF'
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import strutils
|
||||
from nova import utils
|
||||
|
||||
|
@ -16,8 +16,8 @@ import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'fixed_ips')
|
||||
|
||||
|
@ -21,8 +21,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
|
||||
soft_authorize = extensions.soft_extension_authorizer('compute',
|
||||
|
@ -22,8 +22,8 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova import utils
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'flavorextraspecs')
|
||||
|
@ -18,7 +18,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'flavormanage')
|
||||
|
@ -20,8 +20,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -24,8 +24,8 @@ from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova.compute import utils as compute_utils
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import uuidutils
|
||||
|
||||
|
@ -18,8 +18,8 @@ import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -24,7 +24,7 @@ from nova.api.openstack import common
|
||||
from nova.api.openstack import extensions
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import utils
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'fping')
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'hypervisors')
|
||||
|
@ -21,7 +21,7 @@ import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova import compute
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import utils
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -24,7 +24,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
authorize = extensions.extension_authorizer('compute', 'keypairs')
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -15,8 +15,8 @@ from webob import exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -21,8 +21,8 @@ from webob import exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -22,8 +22,8 @@ from webob import exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova import context as nova_context
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
import nova.network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import quota
|
||||
|
||||
|
@ -21,7 +21,7 @@ from nova.api.openstack import xmlutil
|
||||
import nova.context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import quota
|
||||
from nova import utils
|
||||
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import xmlutil
|
||||
import nova.context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova import quota
|
||||
|
@ -23,7 +23,7 @@ from nova.api.openstack import extensions as exts
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
class SchedulerHintsController(wsgi.Controller):
|
||||
|
@ -20,8 +20,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.network.security_group import openstack_driver
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import xmlutils
|
||||
|
||||
|
@ -29,9 +29,9 @@ from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.network.security_group import neutron_driver
|
||||
from nova.network.security_group import openstack_driver
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import xmlutils
|
||||
from nova.virt import netutils
|
||||
|
@ -19,9 +19,9 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import external_event as external_event_obj
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -23,8 +23,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
import nova.exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova import utils
|
||||
|
||||
# NOTE(russellb) There is one other policy, 'legacy', but we don't allow that
|
||||
|
@ -18,8 +18,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import servicegroup
|
||||
from nova import utils
|
||||
|
||||
|
@ -22,7 +22,7 @@ from nova.api.openstack import extensions as exts
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
auth_shelve = exts.extension_authorizer('compute', 'shelve')
|
||||
|
@ -23,9 +23,9 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import timeutils
|
||||
|
||||
authorize_show = extensions.extension_authorizer('compute',
|
||||
|
@ -24,8 +24,8 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova.openstack.common import uuidutils
|
||||
|
@ -16,7 +16,7 @@
|
||||
from oslo.config import cfg
|
||||
|
||||
from nova.api.openstack import extensions as base_extensions
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
ext_opts = [
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import strutils
|
||||
from nova import utils
|
||||
|
||||
|
@ -18,8 +18,8 @@ from webob import exc
|
||||
from nova.api.openstack import common
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.image import glance
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
|
||||
class Controller(object):
|
||||
|
@ -20,8 +20,8 @@ from nova.api.openstack.compute.views import images as views_images
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
import nova.image.glance
|
||||
from nova.openstack.common.gettextutils import _
|
||||
import nova.utils
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import common
|
||||
from nova.api.openstack.compute.views import addresses as view_addresses
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
def make_network(elem):
|
||||
|
@ -44,7 +44,7 @@ import webob.exc
|
||||
from nova.api.openstack.compute.views import limits as limits_views
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import quota
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,7 +16,7 @@ from webob import exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
|
||||
|
@ -21,7 +21,7 @@ from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova.compute import vm_states
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -21,7 +21,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
ALIAS = "os-admin-password"
|
||||
|
@ -25,7 +25,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
|
||||
|
@ -24,8 +24,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.cells import rpcapi as cells_rpcapi
|
||||
from nova.compute import api as compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova.openstack.common import timeutils
|
||||
|
@ -18,8 +18,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
import nova.cert.rpcapi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import network
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
ALIAS = "os-certificates"
|
||||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
@ -18,7 +18,7 @@ import webob
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.consoleauth import rpcapi as consoleauth_rpcapi
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
ALIAS = "os-console-auth-tokens"
|
||||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
@ -23,7 +23,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
ALIAS = "os-console-output"
|
||||
authorize = extensions.extension_authorizer('compute', "v3:" + ALIAS)
|
||||
|
@ -23,7 +23,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova import utils
|
||||
|
@ -23,8 +23,8 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import volume
|
||||
|
||||
|
@ -22,8 +22,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
ALIAS = 'flavor-access'
|
||||
soft_authorize = extensions.soft_extension_authorizer('compute',
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import strutils
|
||||
from nova import utils
|
||||
|
||||
|
@ -19,8 +19,8 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
|
||||
|
||||
class FlavorExtraSpecsController(object):
|
||||
|
@ -21,7 +21,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -20,7 +20,7 @@ import webob.exc
|
||||
from nova.api.openstack import extensions
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
ALIAS = "os-hypervisors"
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import common
|
||||
from nova.api.openstack.compute.views import addresses as views_addresses
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
class IPsController(wsgi.Controller):
|
||||
|
@ -24,7 +24,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
ALIAS = 'keypairs'
|
||||
|
@ -17,7 +17,7 @@ from webob import exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import strutils
|
||||
from nova import utils
|
||||
|
||||
|
@ -21,7 +21,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -23,7 +23,7 @@ from nova.api import validation
|
||||
import nova.context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova import quota
|
||||
|
@ -21,7 +21,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
ALIAS = "os-remote-consoles"
|
||||
|
@ -25,7 +25,7 @@ from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
ALIAS = "os-scheduler-hints"
|
||||
|
||||
|
@ -19,7 +19,7 @@ from nova.api.openstack import common
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
ALIAS = "os-server-actions"
|
||||
authorize_actions = extensions.extension_authorizer('compute',
|
||||
|
@ -18,9 +18,9 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import external_event as external_event_obj
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
class ServerMetadataController(wsgi.Controller):
|
||||
|
@ -31,9 +31,9 @@ from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.image import glance
|
||||
from nova import objects
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova.openstack.common import timeutils
|
||||
|
@ -19,7 +19,7 @@ from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import servicegroup
|
||||
from nova import utils
|
||||
|
||||
|
@ -19,7 +19,7 @@ from nova.api.openstack import common
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
|
||||
|
||||
class Controller(object):
|
||||
|
@ -33,9 +33,9 @@ from nova import block_device
|
||||
from nova import compute
|
||||
from nova.compute import flavors
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova.openstack.common import timeutils
|
||||
|
@ -21,8 +21,8 @@ from nova.api.openstack.compute.views import addresses as views_addresses
|
||||
from nova.api.openstack.compute.views import flavors as views_flavors
|
||||
from nova.api.openstack.compute.views import images as views_images
|
||||
from nova.compute import flavors
|
||||
from nova.i18n import _
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import timeutils
|
||||
from nova import utils
|
||||
|
@ -26,7 +26,7 @@ import nova.api.openstack
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import log as logging
|
||||
import nova.policy
|
||||
|
@ -25,8 +25,8 @@ import webob
|
||||
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova import exception
|
||||
from nova.openstack.common import gettextutils
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova import i18n
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
@ -193,7 +193,7 @@ class Request(webob.Request):
|
||||
if not self.accept_language:
|
||||
return None
|
||||
return self.accept_language.best_match(
|
||||
gettextutils.get_available_languages('nova'))
|
||||
i18n.get_available_languages())
|
||||
|
||||
|
||||
class ActionDispatcher(object):
|
||||
@ -1197,8 +1197,7 @@ class Fault(webob.exc.HTTPException):
|
||||
LOG.debug("Returning %(code)s to user: %(explanation)s",
|
||||
{'code': code, 'explanation': explanation})
|
||||
|
||||
explanation = gettextutils.translate(explanation,
|
||||
user_locale)
|
||||
explanation = i18n.translate(explanation, user_locale)
|
||||
fault_data = {
|
||||
fault_name: {
|
||||
'code': code,
|
||||
@ -1261,13 +1260,9 @@ class RateLimitFault(webob.exc.HTTPException):
|
||||
metadata = {"attributes": {"overLimit": ["code", "retryAfter"]}}
|
||||
|
||||
self.content['overLimit']['message'] = \
|
||||
gettextutils.translate(
|
||||
self.content['overLimit']['message'],
|
||||
user_locale)
|
||||
i18n.translate(self.content['overLimit']['message'], user_locale)
|
||||
self.content['overLimit']['details'] = \
|
||||
gettextutils.translate(
|
||||
self.content['overLimit']['details'],
|
||||
user_locale)
|
||||
i18n.translate(self.content['overLimit']['details'], user_locale)
|
||||
|
||||
xml_serializer = XMLDictSerializer(metadata, XMLNS_V11)
|
||||
serializer = {
|
||||
|
@ -23,7 +23,7 @@ from lxml import etree
|
||||
import six
|
||||
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ from oslo.config import cfg
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova import wsgi
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ Internal implementation of request Body validating middleware.
|
||||
import jsonschema
|
||||
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import uuidutils
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ import re
|
||||
from oslo.config import cfg
|
||||
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import strutils
|
||||
from nova import utils
|
||||
|
@ -22,7 +22,7 @@ done as there's no way to know whether the full path is a valid.
|
||||
"""
|
||||
|
||||
from nova.cells import filters
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -27,10 +27,10 @@ from nova.cells import state as cells_state
|
||||
from nova.cells import utils as cells_utils
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import manager
|
||||
from nova import objects
|
||||
from nova.objects import base as base_obj
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import periodic_task
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user