Merge "Use oslo.i18n"
This commit is contained in:
commit
029b9309c7
bin
cinder-allcinder-apicinder-backupcinder-managecinder-rtstoolcinder-schedulercinder-volumecinder-volume-usage-audit
cinder
api
auth.pycommon.py
contrib
admin_actions.pybackups.pyextended_snapshot_attributes.pyhosts.pyqos_specs_manage.pyquota_classes.pyquotas.pyscheduler_hints.pyservices.pysnapshot_actions.pytypes_extra_specs.pytypes_manage.pyvolume_actions.pyvolume_manage.pyvolume_transfer.pyvolume_type_encryption.pyvolume_unmanage.py
extensions.pymiddleware
openstack
sizelimit.pyv1
v2
xmlutil.pybackup
brick
common
context.pydb/sqlalchemy
api.py
exception.pyflow_utils.pyi18n.pymigrate_repo
manage.py
migration.pyversions
001_cinder_init.py002_quota_class.py003_glance_metadata.py008_add_backup.py009_add_snapshot_metadata_table.py010_add_transfers_table.py015_drop_migrations_table.py016_drop_sm_tables.py017_add_encryption_information.py018_add_qos_specs.py020_add_volume_admin_metadata_table.py021_add_default_quota_class.py023_add_expire_reservations_index.py
image
keymgr
policy.pyquota.pyquota_utils.pyscheduler
service.pyssh_utils.pytests/api/contrib
@ -44,12 +44,12 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(possible_topdir, "cinder", "__init__.py")):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import service
|
||||
from cinder import utils
|
||||
|
@ -34,8 +34,8 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(possible_topdir, "cinder", "__init__.py")):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -38,8 +38,8 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -72,15 +72,15 @@ POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
from cinder import context
|
||||
from cinder import db
|
||||
from cinder.db import migration
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import uuidutils
|
||||
from cinder import rpc
|
||||
|
@ -19,11 +19,10 @@ import sys
|
||||
|
||||
import rtslib
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder import i18n
|
||||
from cinder.i18n import _
|
||||
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
i18n.enable_lazy()
|
||||
|
||||
|
||||
class RtstoolError(Exception):
|
||||
|
@ -38,8 +38,8 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -42,8 +42,8 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -52,12 +52,12 @@ POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
from cinder import context
|
||||
from cinder import db
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import rpc
|
||||
from cinder import utils
|
||||
|
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from cinder.api.middleware import auth
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ import webob
|
||||
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
|
||||
|
@ -19,7 +19,7 @@ from cinder.api import extensions
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder import rpc
|
||||
|
@ -26,7 +26,7 @@ from cinder.api.views import backups as backup_views
|
||||
from cinder.api import xmlutil
|
||||
from cinder import backup as backupAPI
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
|
||||
|
@ -21,7 +21,7 @@ from cinder.api import extensions
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import volume
|
||||
|
||||
|
@ -25,7 +25,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
from cinder import utils
|
||||
|
@ -23,7 +23,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api.views import qos_specs as view_qos_specs
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder import rpc
|
||||
|
@ -20,7 +20,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import quota
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@ from cinder.api import xmlutil
|
||||
from cinder import db
|
||||
from cinder.db.sqlalchemy import api as sqlalchemy_api
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder import quota
|
||||
|
||||
|
@ -17,7 +17,7 @@ import webob.exc
|
||||
from cinder.api import extensions
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api.v2 import volumes
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -22,7 +22,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
from cinder import utils
|
||||
|
@ -17,7 +17,7 @@ import webob
|
||||
from cinder.api import extensions
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import db
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -23,7 +23,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import rpc
|
||||
from cinder.volume import volume_types
|
||||
|
||||
|
@ -23,7 +23,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api.v1 import types
|
||||
from cinder.api.views import types as views_types
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import rpc
|
||||
from cinder.volume import volume_types
|
||||
|
||||
|
@ -20,7 +20,7 @@ from cinder.api import extensions
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder import utils
|
||||
|
@ -20,7 +20,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api.v2.views import volumes as volume_views
|
||||
from cinder.api.v2 import volumes
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import uuidutils
|
||||
from cinder import utils
|
||||
|
@ -23,7 +23,7 @@ from cinder.api.views import transfers as transfer_view
|
||||
from cinder.api import xmlutil
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import transfer as transferAPI
|
||||
from cinder import utils
|
||||
|
@ -22,7 +22,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import rpc
|
||||
from cinder.volume import volume_types
|
||||
|
||||
|
@ -18,7 +18,7 @@ from webob import exc
|
||||
from cinder.api import extensions
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import volume
|
||||
|
||||
|
@ -24,7 +24,7 @@ import cinder.api.openstack
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
import cinder.policy
|
||||
|
@ -26,7 +26,7 @@ import webob.exc
|
||||
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import context
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import jsonutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common.middleware import request_id
|
||||
|
@ -19,7 +19,7 @@ import webob.exc
|
||||
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
from cinder import wsgi as base_wsgi
|
||||
|
@ -21,7 +21,7 @@ from oslo.config import cfg
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import wsgi
|
||||
|
||||
|
@ -21,7 +21,7 @@ WSGI middleware for OpenStack API controllers.
|
||||
import routes
|
||||
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import wsgi as base_wsgi
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from cinder.api import urlmap
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from cinder.api.v1.router import APIRouter as v1_router
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from cinder.api import versions
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -25,8 +25,8 @@ from xml.dom import minidom
|
||||
from xml.parsers import expat
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common import gettextutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder import i18n
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import jsonutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
@ -177,7 +177,7 @@ class Request(webob.Request):
|
||||
"""
|
||||
if not self.accept_language:
|
||||
return None
|
||||
all_languages = gettextutils.get_available_languages('cinder')
|
||||
all_languages = i18n.get_available_languages()
|
||||
return self.accept_language.best_match(all_languages)
|
||||
|
||||
|
||||
@ -1159,7 +1159,7 @@ class Fault(webob.exc.HTTPException):
|
||||
fault_data = {
|
||||
fault_name: {
|
||||
'code': code,
|
||||
'message': gettextutils.translate(explanation, locale)}}
|
||||
'message': i18n.translate(explanation, locale)}}
|
||||
if code == 413:
|
||||
retry = self.wrapped_exc.headers.get('Retry-After', None)
|
||||
if retry:
|
||||
@ -1222,7 +1222,7 @@ class OverLimitFault(webob.exc.HTTPException):
|
||||
|
||||
def translate(msg):
|
||||
locale = request.best_match_language()
|
||||
return gettextutils.translate(msg, locale)
|
||||
return i18n.translate(msg, locale)
|
||||
|
||||
self.content['overLimitFault']['message'] = \
|
||||
translate(self.content['overLimitFault']['message'])
|
||||
|
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from cinder.api.middleware import sizelimit
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -30,7 +30,7 @@ import webob.exc
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api.views import limits as limits_views
|
||||
from cinder.api import xmlutil
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import jsonutils
|
||||
from cinder import quota
|
||||
|
@ -18,7 +18,7 @@ import webob
|
||||
from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import volume
|
||||
from webob import exc
|
||||
|
||||
|
@ -22,7 +22,7 @@ from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder import utils
|
||||
|
@ -18,7 +18,7 @@ import webob
|
||||
from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import volume
|
||||
from webob import exc
|
||||
|
||||
|
@ -23,7 +23,7 @@ from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import uuidutils
|
||||
from cinder import utils
|
||||
|
@ -30,7 +30,7 @@ import webob.exc
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api.views import limits as limits_views
|
||||
from cinder.api import xmlutil
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import jsonutils
|
||||
from cinder import quota
|
||||
|
@ -18,7 +18,7 @@ import webob
|
||||
from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import volume
|
||||
from webob import exc
|
||||
|
||||
|
@ -22,7 +22,7 @@ from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder import utils
|
||||
|
@ -21,7 +21,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api.views import types as views_types
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.volume import volume_types
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ import webob
|
||||
from cinder.api import common
|
||||
from cinder.api.openstack import wsgi
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import volume
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@ from cinder.api.openstack import wsgi
|
||||
from cinder.api.v2.views import volumes as volume_views
|
||||
from cinder.api import xmlutil
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import uuidutils
|
||||
from cinder import utils
|
||||
|
@ -17,7 +17,7 @@ import os.path
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder import utils
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ from cinder.backup import rpcapi as backup_rpcapi
|
||||
from cinder import context
|
||||
from cinder.db import base
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
from cinder.db import base
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import jsonutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from oslo.config import cfg
|
||||
|
@ -53,8 +53,8 @@ from oslo.config import cfg
|
||||
|
||||
from cinder.backup.driver import BackupDriver
|
||||
from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import excutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import strutils
|
||||
from cinder.openstack.common import units
|
||||
|
@ -41,8 +41,8 @@ from oslo.config import cfg
|
||||
|
||||
from cinder.backup.driver import BackupDriver
|
||||
from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import excutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
from cinder.openstack.common import units
|
||||
|
@ -33,7 +33,7 @@ from oslo.config import cfg
|
||||
|
||||
from cinder.backup.driver import BackupDriver
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils
|
||||
from cinder import utils
|
||||
|
@ -39,9 +39,9 @@ from oslo import messaging
|
||||
from cinder.backup import rpcapi as backup_rpcapi
|
||||
from cinder import context
|
||||
from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder import manager
|
||||
from cinder.openstack.common import excutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
"""Exceptions for the Brick library."""
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ from cinder.brick.initiator import host_driver
|
||||
from cinder.brick.initiator import linuxfc
|
||||
from cinder.brick.initiator import linuxscsi
|
||||
from cinder.brick.remotefs import remotefs
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import lockutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import loopingcall
|
||||
|
@ -17,7 +17,7 @@
|
||||
import errno
|
||||
|
||||
from cinder.brick.initiator import linuxscsi
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils as putils
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
import os
|
||||
|
||||
from cinder.brick import executor
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils as putils
|
||||
|
||||
|
@ -26,8 +26,8 @@ import time
|
||||
|
||||
from cinder.brick import exception
|
||||
from cinder.brick import executor
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import fileutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils as putils
|
||||
|
||||
|
@ -24,7 +24,7 @@ import itertools
|
||||
|
||||
from cinder.brick import exception
|
||||
from cinder.brick import executor
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils as putils
|
||||
|
||||
|
@ -21,7 +21,7 @@ import re
|
||||
import six
|
||||
|
||||
from cinder.brick import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils as putils
|
||||
|
||||
|
@ -29,7 +29,7 @@ import socket
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -21,7 +21,7 @@
|
||||
import sqlalchemy
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
import copy
|
||||
import uuid
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import local
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
|
@ -40,7 +40,7 @@ from sqlalchemy.sql import func
|
||||
from cinder.common import sqlalchemyutils
|
||||
from cinder.db.sqlalchemy import models
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
from cinder.openstack.common import uuidutils
|
||||
|
@ -17,8 +17,8 @@ import os
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.enable_lazy()
|
||||
from cinder import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
from cinder.db.sqlalchemy import migrate_repo
|
||||
from cinder import version
|
||||
|
@ -16,7 +16,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey
|
||||
from sqlalchemy import Integer, MetaData, String, Table
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ from migrate import ForeignKeyConstraint
|
||||
from sqlalchemy import Boolean, Column, DateTime
|
||||
from sqlalchemy import MetaData, Integer, String, Table, ForeignKey
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,7 +15,7 @@
|
||||
from sqlalchemy import Column, DateTime, Text, Boolean
|
||||
from sqlalchemy import MetaData, Integer, String, Table, ForeignKey
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,7 +16,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime
|
||||
from sqlalchemy import MetaData, Integer, String, Table
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,7 +13,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime
|
||||
from sqlalchemy import Integer, MetaData, String, Table, ForeignKey
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,7 +13,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime
|
||||
from sqlalchemy import MetaData, String, Table, ForeignKey
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,7 +13,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime, Integer
|
||||
from sqlalchemy import MetaData, String, Table
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,7 +15,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey
|
||||
from sqlalchemy import Integer, MetaData, String, Table
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,7 +16,7 @@
|
||||
from sqlalchemy import Column, ForeignKey, MetaData, Table
|
||||
from sqlalchemy import Boolean, DateTime, Integer, String
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ from sqlalchemy import Boolean, Column, DateTime
|
||||
from sqlalchemy import ForeignKey, MetaData, String, Table
|
||||
from migrate import ForeignKeyConstraint
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,7 +13,7 @@
|
||||
from sqlalchemy import Boolean, Column, DateTime
|
||||
from sqlalchemy import Integer, MetaData, String, Table, ForeignKey
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from oslo.config import cfg
|
||||
from sqlalchemy import MetaData, Table
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
from sqlalchemy import Index, MetaData, Table
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -24,7 +24,7 @@ import sqlalchemy
|
||||
|
||||
from cinder.db.sqlalchemy.api import get_engine
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
|
||||
INIT_VERSION = 000
|
||||
_REPOSITORY = None
|
||||
|
@ -28,7 +28,7 @@ import sys
|
||||
from oslo.config import cfg
|
||||
import webob.exc
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ from taskflow import states
|
||||
from taskflow import task
|
||||
from taskflow.utils import misc
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
70
cinder/i18n.py
Normal file
70
cinder/i18n.py
Normal file
@ -0,0 +1,70 @@
|
||||
# Copyright 2014 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""oslo.i18n integration module.
|
||||
|
||||
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
|
||||
|
||||
"""
|
||||
|
||||
from oslo import i18n
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
|
||||
DOMAIN = 'cinder'
|
||||
|
||||
_translators = i18n.TranslatorFactory(domain=DOMAIN)
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
||||
# Translators for log levels.
|
||||
#
|
||||
# The abbreviated names are meant to reflect the usual use of a short
|
||||
# name like '_'. The "L" is for "log" and the other letter comes from
|
||||
# the level.
|
||||
_LI = _translators.log_info
|
||||
_LW = _translators.log_warning
|
||||
_LE = _translators.log_error
|
||||
_LC = _translators.log_critical
|
||||
|
||||
|
||||
def enable_lazy():
|
||||
return i18n.enable_lazy()
|
||||
|
||||
|
||||
def translate(value, user_locale=None):
|
||||
return i18n.translate(value, user_locale)
|
||||
|
||||
|
||||
def get_available_languages():
|
||||
return i18n.get_available_languages(DOMAIN)
|
||||
|
||||
|
||||
# Parts in oslo-incubator are still using gettextutils._(), _LI(), etc., from
|
||||
# oslo-incubator. Until these parts are changed to use oslo.i18n, Cinder
|
||||
# needs to do something to allow them to work. One option is to continue to
|
||||
# initialize gettextutils, but with the way that Cinder has initialization
|
||||
# spread out over mutltiple entry points, we'll monkey-patch
|
||||
# gettextutils._(), _LI(), etc., to use our oslo.i18n versions.
|
||||
|
||||
# FIXME(dims): Remove the monkey-patching and update openstack-common.conf and
|
||||
# do a sync with oslo-incubator to remove gettextutils once oslo-incubator
|
||||
# isn't using oslo-incubator gettextutils any more.
|
||||
|
||||
gettextutils._ = _
|
||||
gettextutils._LI = _LI
|
||||
gettextutils._LW = _LW
|
||||
gettextutils._LE = _LE
|
||||
gettextutils._LC = _LC
|
@ -31,7 +31,7 @@ from oslo.config import cfg
|
||||
import six.moves.urllib.parse as urlparse
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import jsonutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
|
@ -31,8 +31,8 @@ import tempfile
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import fileutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import imageutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import processutils
|
||||
|
@ -36,9 +36,9 @@ import array
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder.keymgr import key
|
||||
from cinder.keymgr import key_mgr
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import policy
|
||||
from cinder import utils
|
||||
|
||||
|
@ -24,7 +24,7 @@ from oslo.config import cfg
|
||||
from cinder import context
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import quota
|
||||
|
||||
|
@ -22,7 +22,7 @@ Scheduler base class that all Schedulers should inherit from
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder import db
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import timeutils
|
||||
from cinder.volume import rpcapi as volume_rpcapi
|
||||
|
@ -23,7 +23,7 @@ Weighing Functions.
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.scheduler import driver
|
||||
from cinder.scheduler import scheduler_options
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
import math
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common.scheduler import filters
|
||||
|
||||
|
@ -15,8 +15,8 @@ from taskflow.patterns import linear_flow
|
||||
|
||||
from cinder import exception
|
||||
from cinder import flow_utils
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import excutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import rpc
|
||||
from cinder import utils
|
||||
|
@ -23,7 +23,7 @@ from oslo.config import cfg
|
||||
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common.scheduler import filters
|
||||
from cinder.openstack.common.scheduler import weights
|
||||
|
@ -26,9 +26,9 @@ from cinder import context
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder import flow_utils
|
||||
from cinder.i18n import _
|
||||
from cinder import manager
|
||||
from cinder.openstack.common import excutils
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder import quota
|
||||
|
@ -26,7 +26,7 @@ import os
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
|
||||
|
@ -28,7 +28,7 @@ from oslo import messaging
|
||||
from cinder import context
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import loopingcall
|
||||
|
@ -24,7 +24,7 @@ from eventlet import pools
|
||||
import paramiko
|
||||
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -28,7 +28,7 @@ import cinder.backup
|
||||
from cinder import context
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.i18n import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.openstack.common import timeutils
|
||||
from cinder import test
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user