diff --git a/marconi/__init__.py b/marconi/__init__.py index 0edfd9701..5fbf8fec5 100644 --- a/marconi/__init__.py +++ b/marconi/__init__.py @@ -20,8 +20,6 @@ try: _sys.stderr.write('Running from marconi source directory.\n') del _sys except NameError: - import gettext - gettext.install('marconi', unicode=1) import marconi.queues.bootstrap Bootstrap = marconi.queues.bootstrap.Bootstrap diff --git a/marconi/common/api.py b/marconi/common/api.py index eed5aa55c..079e4b2c3 100644 --- a/marconi/common/api.py +++ b/marconi/common/api.py @@ -17,6 +17,7 @@ import jsonschema from jsonschema import validators from marconi.common import errors +from marconi.openstack.common.gettextutils import _ from marconi.openstack.common import log LOG = log.getLogger(__name__) diff --git a/marconi/common/cli.py b/marconi/common/cli.py index 59d9ceb37..de79d0a53 100644 --- a/marconi/common/cli.py +++ b/marconi/common/cli.py @@ -21,6 +21,7 @@ import os import sys import termios +from marconi.openstack.common.gettextutils import _ from marconi.openstack.common import log as logging diff --git a/marconi/common/pipeline.py b/marconi/common/pipeline.py index 48ae8f93c..07ec0df4d 100644 --- a/marconi/common/pipeline.py +++ b/marconi/common/pipeline.py @@ -33,6 +33,7 @@ them do, an AttributeError exception will be raised. import six from marconi.common import decorators +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging LOG = logging.getLogger(__name__) diff --git a/marconi/common/transport/wsgi/helpers.py b/marconi/common/transport/wsgi/helpers.py index 9059fe59d..6a469182a 100644 --- a/marconi/common/transport/wsgi/helpers.py +++ b/marconi/common/transport/wsgi/helpers.py @@ -17,6 +17,7 @@ import falcon +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.transport import validation diff --git a/marconi/queues/bootstrap.py b/marconi/queues/bootstrap.py index 117a6eaec..aef0a6e7a 100644 --- a/marconi/queues/bootstrap.py +++ b/marconi/queues/bootstrap.py @@ -19,6 +19,7 @@ from stevedore import driver from marconi.common.cache import cache as oslo_cache from marconi.common import decorators from marconi.common import errors +from marconi.openstack.common.gettextutils import _ from marconi.openstack.common import log from marconi.queues.storage import pipeline from marconi.queues.storage import sharding diff --git a/marconi/queues/storage/mongodb/messages.py b/marconi/queues/storage/mongodb/messages.py index ebd31467b..63cad68af 100644 --- a/marconi/queues/storage/mongodb/messages.py +++ b/marconi/queues/storage/mongodb/messages.py @@ -27,6 +27,7 @@ import time import pymongo.errors import pymongo.read_preferences +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.openstack.common import timeutils from marconi.queues import storage diff --git a/marconi/queues/storage/mongodb/queues.py b/marconi/queues/storage/mongodb/queues.py index bc069241e..6c9ee2855 100644 --- a/marconi/queues/storage/mongodb/queues.py +++ b/marconi/queues/storage/mongodb/queues.py @@ -23,6 +23,7 @@ Field Mappings: import pymongo.errors +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.openstack.common import timeutils from marconi.queues import storage diff --git a/marconi/queues/storage/pipeline.py b/marconi/queues/storage/pipeline.py index 33ae8f144..f4702ffdc 100644 --- a/marconi/queues/storage/pipeline.py +++ b/marconi/queues/storage/pipeline.py @@ -19,6 +19,7 @@ from stevedore import driver from marconi import common from marconi.common import decorators +from marconi.openstack.common.gettextutils import _ from marconi.openstack.common import log as logging from marconi.queues.storage import base diff --git a/marconi/queues/transport/auth.py b/marconi/queues/transport/auth.py index 73cde25e1..4a8668c38 100644 --- a/marconi/queues/transport/auth.py +++ b/marconi/queues/transport/auth.py @@ -17,6 +17,7 @@ from keystoneclient.middleware import auth_token +from marconi.openstack.common.gettextutils import _ from marconi.openstack.common import log @@ -40,7 +41,7 @@ class KeystoneAuth(object): @classmethod def install(cls, app, conf): """Install Auth check on application.""" - LOG.debug(_(u"Installing Keystone's auth protocol")) + LOG.debug(_(u'Installing Keystone\'s auth protocol')) cls._register_opts(conf) conf = dict(conf.get(cls.OPT_GROUP_NAME)) return auth_token.AuthProtocol(app, conf=conf) diff --git a/marconi/queues/transport/wsgi/claims.py b/marconi/queues/transport/wsgi/claims.py index 332ad68eb..35216c054 100644 --- a/marconi/queues/transport/wsgi/claims.py +++ b/marconi/queues/transport/wsgi/claims.py @@ -16,6 +16,7 @@ import falcon import six +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.storage import errors as storage_errors from marconi.queues.transport import utils diff --git a/marconi/queues/transport/wsgi/driver.py b/marconi/queues/transport/wsgi/driver.py index 7da07c3c7..33ba86a97 100644 --- a/marconi/queues/transport/wsgi/driver.py +++ b/marconi/queues/transport/wsgi/driver.py @@ -24,6 +24,7 @@ import six from marconi.common import decorators from marconi.common.transport import version from marconi.common.transport.wsgi import helpers +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues import transport from marconi.queues.transport import auth, validation diff --git a/marconi/queues/transport/wsgi/errors.py b/marconi/queues/transport/wsgi/errors.py index e3fb342ba..051b6da69 100644 --- a/marconi/queues/transport/wsgi/errors.py +++ b/marconi/queues/transport/wsgi/errors.py @@ -15,6 +15,8 @@ import falcon +from marconi.openstack.common.gettextutils import _ + class HTTPServiceUnavailable(falcon.HTTPServiceUnavailable): """Wraps falcon.HTTPServiceUnavailable with Marconi messaging.""" diff --git a/marconi/queues/transport/wsgi/messages.py b/marconi/queues/transport/wsgi/messages.py index 77732136d..201b05c2a 100644 --- a/marconi/queues/transport/wsgi/messages.py +++ b/marconi/queues/transport/wsgi/messages.py @@ -16,6 +16,7 @@ import falcon import six +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.storage import errors as storage_errors from marconi.queues.transport import utils diff --git a/marconi/queues/transport/wsgi/metadata.py b/marconi/queues/transport/wsgi/metadata.py index f8e5999dc..f6a1a603c 100644 --- a/marconi/queues/transport/wsgi/metadata.py +++ b/marconi/queues/transport/wsgi/metadata.py @@ -16,6 +16,7 @@ import falcon import six +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.storage import errors as storage_errors from marconi.queues.transport import utils diff --git a/marconi/queues/transport/wsgi/queues.py b/marconi/queues/transport/wsgi/queues.py index b1277a3af..2176bd7ba 100644 --- a/marconi/queues/transport/wsgi/queues.py +++ b/marconi/queues/transport/wsgi/queues.py @@ -16,6 +16,7 @@ import falcon import six +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.transport import utils from marconi.queues.transport import validation diff --git a/marconi/queues/transport/wsgi/stats.py b/marconi/queues/transport/wsgi/stats.py index 90e979374..e5699e382 100644 --- a/marconi/queues/transport/wsgi/stats.py +++ b/marconi/queues/transport/wsgi/stats.py @@ -15,6 +15,7 @@ import falcon +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.storage import errors as storage_errors from marconi.queues.transport import utils diff --git a/marconi/queues/transport/wsgi/utils.py b/marconi/queues/transport/wsgi/utils.py index 39cffd24d..4682c0073 100644 --- a/marconi/queues/transport/wsgi/utils.py +++ b/marconi/queues/transport/wsgi/utils.py @@ -16,6 +16,7 @@ import uuid +from marconi.openstack.common.gettextutils import _ import marconi.openstack.common.log as logging from marconi.queues.transport import utils from marconi.queues.transport.wsgi import errors diff --git a/tox.ini b/tox.ini index 6bcfef640..14abfb315 100644 --- a/tox.ini +++ b/tox.ini @@ -31,5 +31,8 @@ setenv = NOSE_WITH_COVERAGE=1 commands = {posargs} [flake8] -builtins = _,__MARCONI_SETUP__ +builtins = __MARCONI_SETUP__ exclude = .venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv + +[hacking] +import_exceptions = marconi.openstack.common.gettextutils._