Change Glance to use i18n instead of gettextutils
Changing all Glance files to use i18n instead of gettextutils for log translations. Finishes bp refactoring-glance-logging Change-Id: I90d6ab4f7e09f4e7591921f9526de6370ebdb789
This commit is contained in:
parent
4f46fb67f2
commit
fa7888d920
|
@ -20,13 +20,13 @@ from oslo.utils import excutils
|
|||
from oslo.utils import units
|
||||
|
||||
from glance.common import exception
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
from glance.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
|
|
|
@ -33,16 +33,16 @@ from glance.common import exception
|
|||
from glance.common import utils
|
||||
from glance.common import wsgi
|
||||
import glance.db
|
||||
from glance import i18n
|
||||
from glance import image_cache
|
||||
from glance import notifier
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.registry.client.v1.api as registry
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LE = gettextutils._LE
|
||||
_LW = gettextutils._LW
|
||||
_LI = i18n._LI
|
||||
_LE = i18n._LE
|
||||
_LW = i18n._LW
|
||||
|
||||
PATTERNS = {
|
||||
('v1', 'GET'): re.compile(r'^/v1/images/([^\/]+)$'),
|
||||
|
|
|
@ -21,11 +21,11 @@ import routes
|
|||
|
||||
from glance.api import cached_images
|
||||
from glance.common import wsgi
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LI = i18n._LI
|
||||
|
||||
|
||||
class CacheManageFilter(wsgi.Middleware):
|
||||
|
|
|
@ -20,11 +20,11 @@ Use gzip compression if the client accepts it.
|
|||
import re
|
||||
|
||||
from glance.common import wsgi
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LI = i18n._LI
|
||||
|
||||
|
||||
class GzipMiddleware(wsgi.Middleware):
|
||||
|
|
|
@ -44,15 +44,15 @@ from glance.common import exception
|
|||
from glance.common import property_utils
|
||||
from glance.common import utils
|
||||
from glance.common import wsgi
|
||||
from glance.i18n import _LE
|
||||
from glance import i18n
|
||||
from glance import notifier
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.registry.client.v1.api as registry
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
SUPPORTED_PARAMS = glance.api.v1.SUPPORTED_PARAMS
|
||||
SUPPORTED_FILTERS = glance.api.v1.SUPPORTED_FILTERS
|
||||
ACTIVE_IMMUTABLE = glance.api.v1.ACTIVE_IMMUTABLE
|
||||
|
|
|
@ -21,16 +21,16 @@ from glance.common import exception
|
|||
from glance.common import store_utils
|
||||
from glance.common import utils
|
||||
import glance.db
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.registry.client.v1.api as registry
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
|
||||
def initiate_deletion(req, location_data, id):
|
||||
|
|
|
@ -22,13 +22,13 @@ from glance.common import utils
|
|||
from glance.common import wsgi
|
||||
import glance.db
|
||||
import glance.gateway
|
||||
from glance import i18n
|
||||
import glance.notifier
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LE = i18n._LE
|
||||
|
||||
|
||||
class ImageDataController(object):
|
||||
|
|
|
@ -30,13 +30,13 @@ from glance.common import utils
|
|||
from glance.common import wsgi
|
||||
import glance.db
|
||||
import glance.gateway
|
||||
from glance import i18n
|
||||
import glance.notifier
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.schema
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LW = gettextutils._LW
|
||||
_LW = i18n._LW
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('disk_formats', 'glance.common.config', group='image_format')
|
||||
|
|
|
@ -30,13 +30,13 @@ from glance.common import utils
|
|||
from glance.common import wsgi
|
||||
import glance.db
|
||||
import glance.gateway
|
||||
from glance import i18n
|
||||
import glance.notifier
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.schema
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LW = gettextutils._LW
|
||||
_LW = i18n._LW
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('task_time_to_live', 'glance.common.config', group='task')
|
||||
|
|
|
@ -48,13 +48,13 @@ from glance.common import utils
|
|||
from glance.db import migration as db_migration
|
||||
from glance.db.sqlalchemy import api as db_api
|
||||
from glance.db.sqlalchemy import metadata
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
from glance.openstack.common import log
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = log.getLogger(__name__)
|
||||
_LW = gettextutils._LW
|
||||
_LW = i18n._LW
|
||||
|
||||
|
||||
# Decorators for actions
|
||||
|
|
|
@ -29,13 +29,13 @@ from webob import exc
|
|||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
from glance.openstack.common import log
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LE = gettextutils._LE
|
||||
_LW = gettextutils._LW
|
||||
_LI = i18n._LI
|
||||
_LE = i18n._LE
|
||||
_LW = i18n._LW
|
||||
|
||||
# If ../glance/__init__.py exists, add ../ to Python search path, so that
|
||||
# it will override what happens to be installed in /usr/(local/)lib/python...
|
||||
|
|
|
@ -19,12 +19,12 @@ from oslo.config import cfg
|
|||
|
||||
from glance.common import utils
|
||||
import glance.db as db_api
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
from glance import scrubber
|
||||
|
||||
_LE = gettextutils._LE
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LW = i18n._LW
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ Various conveniences used for migration scripts
|
|||
|
||||
import sqlalchemy.types
|
||||
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LI = i18n._LI
|
||||
|
||||
|
||||
String = lambda length: sqlalchemy.types.String(
|
||||
|
|
|
@ -18,11 +18,11 @@ import sqlalchemy
|
|||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LE = i18n._LE
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
|
|
@ -37,13 +37,13 @@ import sqlalchemy
|
|||
from glance.common import crypt
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
CONF = cfg.CONF
|
||||
|
||||
CONF.import_opt('metadata_encryption_key', 'glance.common.config')
|
||||
|
|
|
@ -26,13 +26,13 @@ from oslo.utils import units
|
|||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
image_cache_opts = [
|
||||
cfg.StrOpt('image_cache_driver', default='sqlite',
|
||||
|
|
|
@ -30,14 +30,14 @@ from oslo.config import cfg
|
|||
from oslo.utils import excutils
|
||||
|
||||
from glance.common import exception
|
||||
from glance import i18n
|
||||
from glance.image_cache.drivers import base
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
sqlite_opts = [
|
||||
cfg.StrOpt('image_cache_sqlite_db', default='cache.db',
|
||||
|
|
|
@ -64,14 +64,14 @@ import xattr
|
|||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance import i18n
|
||||
from glance.image_cache.drivers import base
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@ import glance_store
|
|||
|
||||
from glance.common import exception
|
||||
from glance import context
|
||||
from glance import i18n
|
||||
from glance.image_cache import base
|
||||
from glance.openstack.common import gettextutils
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.registry.client.v1.api as registry
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
|
||||
class Prefetcher(base.CacheApp):
|
||||
|
|
|
@ -23,11 +23,11 @@ from oslo.utils import excutils
|
|||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
import glance.domain.proxy
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
|
||||
_LE = gettextutils._LE
|
||||
_LE = i18n._LE
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
|
|
@ -24,12 +24,12 @@ import glance.common.exception as exception
|
|||
from glance.common import utils
|
||||
import glance.domain
|
||||
import glance.domain.proxy
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LI = i18n._LI
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('image_member_quota', 'glance.common.config')
|
||||
CONF.import_opt('image_property_quota', 'glance.common.config')
|
||||
|
|
|
@ -26,14 +26,14 @@ from glance.common import exception
|
|||
from glance.common import utils
|
||||
from glance.common import wsgi
|
||||
import glance.db
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@ from glance.common import exception
|
|||
from glance.common import utils
|
||||
from glance.common import wsgi
|
||||
import glance.db
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LI = gettextutils._LI
|
||||
_LW = gettextutils._LW
|
||||
_LI = i18n._LI
|
||||
_LW = i18n._LW
|
||||
|
||||
|
||||
class Controller(object):
|
||||
|
|
|
@ -23,13 +23,13 @@ from oslo.utils import excutils
|
|||
|
||||
from glance.common.client import BaseClient
|
||||
from glance.common import crypt
|
||||
from glance.openstack.common import gettextutils
|
||||
from glance import i18n
|
||||
import glance.openstack.common.log as logging
|
||||
from glance.registry.api.v1 import images
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
_LE = gettextutils._LE
|
||||
_LI = gettextutils._LI
|
||||
_LE = i18n._LE
|
||||
_LI = i18n._LI
|
||||
|
||||
|
||||
class RegistryClient(BaseClient):
|
||||
|
|
Loading…
Reference in New Issue