Remove deprecated use of gettextutils import _

The initial hacking check I wrote allowed users to check in code
using 'from cinder.openstack.common.gettextutils import _' or
'from cinder.i18n import _'.  This was to ease the transition for
code that was in flight with the old import.

Now that we have moved Cinder over to using cinder.i18n and most
of the code that was in flight with the old import has been merged
and/or fixed, I am updating the hacking check to enforce the use of
cinder.i18n and fixing the cases that still had the old import.

Change-Id: Iff6ccac1996c06bbc5defd5139113a2baa0b677c
This commit is contained in:
Jay S. Bryant 2014-09-09 22:07:48 -05:00 committed by Rushi Agrawal
parent 35b6b55ff3
commit a108a828bb
11 changed files with 11 additions and 11 deletions

@ -18,7 +18,7 @@
from oslo.config import cfg
import paste.urlmap
from cinder.openstack.common.gettextutils import _
from cinder.i18n import _
from cinder.openstack.common import log as logging

@ -36,7 +36,7 @@ translated_log = re.compile(
"\(\s*_\(\s*('|\")")
string_translation = re.compile(r"(.)*_\(\s*('|\")")
vi_header_re = re.compile(r"^#\s+vim?:.+")
underscore_import_check = re.compile(r"(.)*import _(.)*")
underscore_import_check = re.compile(r"(.)*i18n\s+import\s+_(.)*")
# We need this for cases where they have created their own _ function.
custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*")
no_audit_log = re.compile(r"(.)*LOG\.audit(.)*")

@ -27,10 +27,10 @@ from keystoneclient.v2_0 import client as keystone_client
from oslo.config import cfg
from cinder import exception
from cinder.i18n import _
from cinder.keymgr import key as keymgr_key
from cinder.keymgr import key_mgr
from cinder.openstack.common import excutils
from cinder.openstack.common.gettextutils import _ # noqa
from cinder.openstack.common import log as logging
CONF = cfg.CONF

@ -18,7 +18,7 @@ import errno
import six
from cinder import exception
from cinder.openstack.common.gettextutils import _
from cinder.i18n import _
from cinder.openstack.common import log as logging
from cinder.volume import driver
from cinder.volume.drivers.prophetstor import dplcommon

@ -16,7 +16,7 @@
import errno
from cinder import exception
from cinder.openstack.common.gettextutils import _
from cinder.i18n import _
from cinder.openstack.common import log as logging
import cinder.volume.driver
from cinder.volume.drivers.prophetstor import dplcommon

@ -26,7 +26,7 @@ import time
import six
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 loopingcall
from cinder.openstack.common import units

@ -23,8 +23,8 @@ import tempfile
from oslo.config import cfg
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder.openstack.common.gettextutils import _
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils as putils
from cinder.openstack.common import units

@ -20,8 +20,8 @@ from oslo.config import cfg
from cinder.brick.remotefs import remotefs
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder.openstack.common.gettextutils import _
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils as putils
from cinder.openstack.common import units

@ -17,8 +17,8 @@
Classes and utility methods for datastore selection.
"""
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.volume.drivers.vmware import error_util
from cinder.volume.drivers.vmware import vim_util

@ -21,7 +21,7 @@ if sys.platform == 'win32':
from cinder.brick.remotefs import remotefs
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__)

@ -21,9 +21,9 @@ import sys
from oslo.config import cfg
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
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 units
from cinder import utils