Use oslo.i18n

Keystone was using the I18N functions from oslo-incubator. With
this change, Keystone uses the new oslo.i18n library.

The tests were adapted to not use internal symbols because these are
subject to change.

Change-Id: I1b13fcc630952695424fccd91bcd157d702851f1
This commit is contained in:
Brant Knudson 2014-07-02 18:02:08 -05:00
parent bbfd58a6c1
commit e527802f68
65 changed files with 171 additions and 145 deletions

View File

@ -19,6 +19,11 @@ import os
import socket
import sys
from oslo import i18n
from paste import deploy
import pbr.version
# If ../keystone/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),
@ -29,16 +34,12 @@ if os.path.exists(os.path.join(possible_topdir,
'__init__.py')):
sys.path.insert(0, possible_topdir)
from paste import deploy
import pbr.version
from keystone.openstack.common import gettextutils
# NOTE(dstanek): gettextutils.enable_lazy() must be called before
# gettextutils._() is called to ensure it has the desired lazy lookup
# NOTE(dstanek): i18n.enable_lazy() must be called before
# keystone.i18n._() is called to ensure it has the desired lazy lookup
# behavior. This includes cases, like keystone.exceptions, where
# gettextutils._() is called at import time.
gettextutils.enable_lazy()
# keystone.i18n._() is called at import time.
i18n.enable_lazy()
from keystone import backends
from keystone.common import dependency
@ -46,7 +47,7 @@ from keystone.common import environment
from keystone.common import sql
from keystone.common import utils
from keystone import config
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import service
from keystone.openstack.common import systemd

View File

@ -15,14 +15,16 @@
import logging
import os
from oslo import i18n
from paste import deploy
from keystone.openstack.common import gettextutils
# NOTE(dstanek): gettextutils.enable_lazy() must be called before
# gettextutils._() is called to ensure it has the desired lazy lookup
# NOTE(dstanek): i18n.enable_lazy() must be called before
# keystone.i18n._() is called to ensure it has the desired lazy lookup
# behavior. This includes cases, like keystone.exceptions, where
# gettextutils._() is called at import time.
gettextutils.enable_lazy()
# keystone.i18n._() is called at import time.
i18n.enable_lazy()
from keystone import backends
from keystone.common import dependency

View File

@ -16,7 +16,7 @@ from keystone import assignment
from keystone import clean
from keystone.common import kvs
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
class Assignment(kvs.Base, assignment.Driver):

View File

@ -25,8 +25,8 @@ from keystone.common import ldap as common_ldap
from keystone.common import models
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.identity.backends import ldap as ldap_identity
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log

View File

@ -20,7 +20,7 @@ from keystone import clean
from keystone.common import sql
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
CONF = config.CONF

View File

@ -25,7 +25,7 @@ from keystone.common import controller
from keystone.common import dependency
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -25,8 +25,8 @@ from keystone.common import driver_hints
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone import notifications
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log

View File

@ -21,8 +21,7 @@ from keystone.common import wsgi
from keystone import config
from keystone.contrib import federation
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common.gettextutils import _LI # noqa
from keystone.i18n import _, _LI
from keystone.openstack.common import importutils
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log

View File

@ -22,7 +22,7 @@ from keystone import auth
from keystone.common import config
from keystone.common import dependency
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import versionutils

View File

@ -18,7 +18,7 @@ from keystone.common import dependency
from keystone.contrib.oauth1 import core as oauth
from keystone.contrib.oauth1 import validator
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -15,7 +15,7 @@
from keystone import auth
from keystone.common import dependency
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
METHOD_NAME = 'password'

View File

@ -20,7 +20,7 @@ from keystone.catalog.backends import kvs
from keystone.catalog import core
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import versionutils

View File

@ -21,7 +21,7 @@ from keystone.common import controller
from keystone.common import dependency
from keystone.common import wsgi
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
INTERFACES = ['public', 'internal', 'admin']

View File

@ -24,7 +24,7 @@ from keystone.common import driver_hints
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -15,7 +15,7 @@
import six
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
def check_length(property_name, value, min_length=1, max_length=64):

View File

@ -25,8 +25,8 @@ from keystone.common import sql
from keystone.common.sql import migration_helpers
from keystone.common import utils
from keystone import config
from keystone.i18n import _
from keystone import identity
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log
from keystone import token

View File

@ -18,7 +18,7 @@
from keystone.contrib import federation
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -43,7 +43,7 @@ import string
import six
from six.moves import urllib
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
class InvalidBase64Error(ValueError):

View File

@ -20,7 +20,7 @@ from dogpile.cache import util as dp_util
import six
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import importutils
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -20,7 +20,7 @@ from dogpile.cache import util
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import importutils
from keystone.openstack.common import log

View File

@ -22,7 +22,7 @@ from keystone.common import utils
from keystone.common import wsgi
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -26,8 +26,8 @@ See also:
import six
from keystone.i18n import _
from keystone import notifications
from keystone.openstack.common.gettextutils import _
REGISTRY = {}

View File

@ -26,7 +26,7 @@ import eventlet
import eventlet.wsgi
import greenlet
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -25,7 +25,7 @@ from dogpile.cache.backends import memcached
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -26,7 +26,7 @@ import six
from keystone.common import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import importutils
from keystone.openstack.common import log

View File

@ -22,7 +22,7 @@ import ldap.filter
import six
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
LOG = log.getLogger(__name__)

View File

@ -98,7 +98,7 @@ import re
import six
from keystone.common import base64utils
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
PEM_TYPE_TO_HEADER = {

View File

@ -25,7 +25,7 @@ import re
import six
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
DOCTYPE = '<?xml version="1.0" encoding="UTF-8"?>'

View File

@ -34,7 +34,7 @@ from sqlalchemy import types as sql_types
from keystone.common import utils
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log

View File

@ -28,7 +28,7 @@ from keystone.common.sql import migrate_repo
from keystone import config
from keystone import contrib
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import importutils
from keystone.openstack.common import jsonutils

View File

@ -30,7 +30,7 @@ from six import moves
from keystone.common import config
from keystone.common import environment
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
from keystone.openstack.common import strutils

View File

@ -18,6 +18,7 @@
"""Utility methods for working with WSGI servers."""
from oslo import i18n
import routes.middleware
import six
import webob.dec
@ -27,8 +28,7 @@ from keystone.common import config
from keystone.common import dependency
from keystone.common import utils
from keystone import exception
from keystone.openstack.common import gettextutils
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import importutils
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
@ -103,7 +103,7 @@ def best_match_language(req):
if not req.accept_language:
return None
return req.accept_language.best_match(
gettextutils.get_available_languages('keystone'))
i18n.get_available_languages('keystone'))
class BaseApplication(object):
@ -652,7 +652,7 @@ def render_exception(error, context=None, request=None, user_locale=None):
"""Forms a WSGI response based on the current error."""
error_message = error.args[0]
message = gettextutils.translate(error_message, desired_locale=user_locale)
message = i18n.translate(error_message, desired_locale=user_locale)
if message is error_message:
# translate() didn't do anything because it wasn't a Message,
# convert to a string.

View File

@ -44,7 +44,7 @@ from keystone.common import dependency
from keystone.common import utils
from keystone.common import wsgi
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone import token

View File

@ -14,7 +14,7 @@
from keystone.common import sql
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
class ProjectEndpoint(sql.ModelBase, sql.DictBase):

View File

@ -17,7 +17,7 @@ from keystone.common import dependency
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -19,7 +19,7 @@ import six
from keystone.common import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -21,7 +21,7 @@ import six
from keystone.common import sql
from keystone.contrib.oauth1 import core
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import timeutils

View File

@ -21,7 +21,7 @@ from keystone import config
from keystone.contrib.oauth1 import core as oauth1
from keystone.contrib.oauth1 import validator
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import timeutils

View File

@ -13,7 +13,7 @@
from keystone.common import controller
from keystone.common import dependency
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import timeutils

View File

@ -22,8 +22,8 @@ from keystone.common import manager
from keystone import config
from keystone.contrib.revoke import model
from keystone import exception
from keystone.i18n import _
from keystone import notifications
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -18,7 +18,7 @@ from keystone.common import controller
from keystone.common import dependency
from keystone.common import driver_hints
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils

View File

@ -15,7 +15,7 @@
import six
from keystone.common import config
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import strutils

View File

@ -141,7 +141,7 @@ class CheckForTranslationsInDebugLogging(BaseASTChecker):
CHECK_DESC = 'K005 Using translated string in debug logging'
LOG_MODULES = ('logging', 'keystone.openstack.common.log')
I18N_MODULES = ('keystone.openstack.common.gettextutils._')
I18N_MODULES = ('keystone.i18n._')
def __init__(self, tree, filename):
super(CheckForTranslationsInDebugLogging, self).__init__(

58
keystone/i18n.py Normal file
View File

@ -0,0 +1,58 @@
# 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
_translators = i18n.TranslatorFactory(domain='keystone')
# 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
# Parts in oslo-incubator are still using gettextutils._(), _LI(), etc., from
# oslo-incubator. Until these parts are changed to use oslo.i18n, Keystone
# needs to do something to allow them to work. One option is to continue to
# initialize gettextutils, but with the way that Keystone has initialization
# spread out over keystone-all, httpd/keystone.py, and keystone.tests, we'll
# monkey-patch gettextutils._(), _LI(), etc., to use our oslo.i18n versions.
# FIXME(blk-u): 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.
from keystone.openstack.common import gettextutils
gettextutils._ = _
gettextutils._LI = _LI
gettextutils._LW = _LW
gettextutils._LE = _LE
gettextutils._LC = _LC

View File

@ -15,8 +15,8 @@
from keystone.common import kvs
from keystone.common import utils
from keystone import exception
from keystone.i18n import _
from keystone import identity
from keystone.openstack.common.gettextutils import _
class _UserIdToDomainId(object):

View File

@ -25,8 +25,8 @@ from keystone.common import models
from keystone.common import utils
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone import identity
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log

View File

@ -16,8 +16,8 @@ from keystone.common import dependency
from keystone.common import sql
from keystone.common import utils
from keystone import exception
from keystone.i18n import _
from keystone import identity
from keystone.openstack.common.gettextutils import _
# Import assignment sql to ensure that the models defined in there are
# available for the reference from User and Group to Domain.id.

View File

@ -18,7 +18,7 @@ from keystone.common import controller
from keystone.common import dependency
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -28,9 +28,9 @@ from keystone.common import driver_hints
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.identity.mapping_backends import mapping
from keystone import notifications
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import importutils
from keystone.openstack.common import log

View File

@ -21,7 +21,7 @@ from keystone.common import serializer
from keystone.common import utils
from keystone.common import wsgi
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
from keystone.openstack.common import versionutils

View File

@ -25,7 +25,7 @@ from pycadf import cadftype
from pycadf import eventfactory
from pycadf import resource
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo import i18n
import six
@ -37,13 +38,10 @@ if six.PY3:
sys.modules['pycadf'] = mock.Mock()
sys.modules['paste'] = mock.Mock()
# NOTE(dstanek): gettextutils.enable_lazy() must be called before
# gettextutils._() is called to ensure it has the desired lazy lookup
# NOTE(dstanek): i18n.enable_lazy() must be called before
# keystone.i18n._() is called to ensure it has the desired lazy lookup
# behavior. This includes cases, like keystone.exceptions, where
# gettextutils._() is called at import time.
from keystone.openstack.common import gettextutils as _gettextutils
_gettextutils.enable_lazy()
# keystone.i18n._() is called at import time.
i18n.enable_lazy()
from keystone.tests.core import * # noqa

View File

@ -33,8 +33,6 @@ import six
from testtools import testcase
import webob
from keystone.openstack.common import gettextutils
# NOTE(ayoung)
# environment.use_eventlet must run before any of the code that will
# call the eventlet monkeypatching.
@ -49,9 +47,9 @@ from keystone.common.kvs import core as kvs_core
from keystone.common import utils as common_utils
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone import notifications
from keystone.openstack.common.fixture import config as config_fixture
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log
from keystone.tests import ksfixtures
@ -578,11 +576,11 @@ class TestCase(BaseTestCase):
if isinstance(expected_regexp, six.string_types):
expected_regexp = re.compile(expected_regexp)
if isinstance(exc_value.args[0], gettextutils.Message):
if not expected_regexp.search(six.text_type(exc_value)):
if isinstance(exc_value.args[0], unicode):
if not expected_regexp.search(unicode(exc_value)):
raise self.failureException(
'"%s" does not match "%s"' %
(expected_regexp.pattern, six.text_type(exc_value)))
(expected_regexp.pattern, unicode(exc_value)))
else:
if not expected_regexp.search(str(exc_value)):
raise self.failureException(

View File

@ -95,10 +95,10 @@ class HackingCode(fixtures.Fixture):
'code': """
import logging
import logging as stlib_logging
from keystone.i18n import _
from keystone.i18n import _ as oslog_i18n
from keystone.openstack.common import log
from keystone.openstack.common import log as oslo_logging
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common.gettextutils import _ as oslog_i18n
# stdlib logging
L0 = logging.getLogger()

View File

@ -16,17 +16,14 @@ import gettext
import socket
import uuid
from babel import localedata
import mock
from oslotest import mockpatch
from oslo import i18n
from testtools import matchers
import webob
from keystone.common import environment
from keystone.common import wsgi
from keystone import exception
from keystone.openstack.common import gettextutils
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import jsonutils
from keystone import tests
@ -272,77 +269,49 @@ class MiddlewareTest(BaseWSGITest):
class LocalizedResponseTest(tests.TestCase):
def setUp(self):
super(LocalizedResponseTest, self).setUp()
gettextutils._AVAILABLE_LANGUAGES.clear()
self.addCleanup(gettextutils._AVAILABLE_LANGUAGES.clear)
def _set_expected_languages(self, all_locales, avail_locales=None):
# Override localedata.locale_identifiers to return some locales.
def returns_some_locales(*args, **kwargs):
return all_locales
self.useFixture(mockpatch.PatchObject(
localedata, 'locale_identifiers', returns_some_locales))
# Override gettext.find to return other than None for some languages.
def fake_gettext_find(lang_id, *args, **kwargs):
found_ret = '/keystone/%s/LC_MESSAGES/keystone.mo' % lang_id
if avail_locales is None:
# All locales are available.
return found_ret
languages = kwargs['languages']
if languages[0] in avail_locales:
return found_ret
return None
self.useFixture(mockpatch.PatchObject(
gettext, 'find', fake_gettext_find))
def test_request_match_default(self):
# The default language if no Accept-Language is provided is None
req = webob.Request.blank('/')
self.assertIsNone(wsgi.best_match_language(req))
def test_request_match_language_expected(self):
@mock.patch.object(i18n, 'get_available_languages')
def test_request_match_language_expected(self, mock_gal):
# If Accept-Language is a supported language, best_match_language()
# returns it.
self._set_expected_languages(all_locales=['it'])
language = uuid.uuid4().hex
mock_gal.return_value = [language]
req = webob.Request.blank('/', headers={'Accept-Language': 'it'})
self.assertEqual(wsgi.best_match_language(req), 'it')
req = webob.Request.blank('/', headers={'Accept-Language': language})
self.assertEqual(wsgi.best_match_language(req), language)
def test_request_match_language_unexpected(self):
@mock.patch.object(i18n, 'get_available_languages')
def test_request_match_language_unexpected(self, mock_gal):
# If Accept-Language is a language we do not support,
# best_match_language() returns None.
self._set_expected_languages(all_locales=['it'])
supported_language = uuid.uuid4().hex
mock_gal.return_value = [supported_language]
req = webob.Request.blank('/', headers={'Accept-Language': 'zh'})
request_language = uuid.uuid4().hex
req = webob.Request.blank(
'/', headers={'Accept-Language': request_language})
self.assertIsNone(wsgi.best_match_language(req))
def test_static_translated_string_is_Message(self):
# Statically created message strings are Message objects so that they
# are lazy-translated.
self.assertIsInstance(exception.Unauthorized.message_format,
gettextutils.Message)
def test_static_translated_string_is_lazy_translatable(self):
# Statically created message strings are an object that can get
# lazy-translated rather than a regular string.
self.assertNotEqual(type(exception.Unauthorized.message_format),
unicode)
def test_dynamic_translated_string_is_Message(self):
# Dynamically created message strings are Message objects so that they
# are lazy-translated.
self.assertIsInstance(_('The resource could not be found.'),
gettextutils.Message)
def test_get_localized_response(self):
@mock.patch.object(i18n, 'get_available_languages')
def test_get_localized_response(self, mock_gal):
# If the request has the Accept-Language set to a supported language
# and an exception is raised by the application that is translatable
# then the response will have the translated message.
language = uuid.uuid4().hex
self._set_expected_languages(all_locales=[language])
mock_gal.return_value = [language]
# The arguments for the xlated message format have to match the args
# for the chosen exception (exception.NotFound)

View File

@ -21,7 +21,7 @@ import six
from keystone.common import kvs
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils
from keystone import token

View File

@ -22,7 +22,7 @@ from keystone.common import dependency
from keystone.common import wsgi
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -26,7 +26,7 @@ from keystone.common import dependency
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -24,7 +24,7 @@ from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -21,7 +21,7 @@ from keystone.common import dependency
from keystone import config
from keystone.contrib import federation
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone import token
from keystone.token import provider

View File

@ -19,7 +19,7 @@ from keystoneclient.common import cms
from keystone.common import environment
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
from keystone.token.providers import common

View File

@ -17,7 +17,7 @@ from keystoneclient.common import cms
from keystone.common import environment
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
from keystone.token.providers import common

View File

@ -21,7 +21,7 @@ from keystone.common import controller
from keystone.common import dependency
from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.i18n import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils

View File

@ -22,8 +22,8 @@ from keystone.common import dependency
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone import notifications
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log

View File

@ -78,5 +78,6 @@ envdir = {toxworkdir}/venv
commands = {toxinidir}/tools/config/generate_sample.sh
[hacking]
import_exceptions = keystone.openstack.common.gettextutils._
import_exceptions =
keystone.i18n
local-check-factory = keystone.hacking.checks.factory