Remove log translations

Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: If4d80503845a14ebf3778cad36b6a21aac4eec54
This commit is contained in:
liyi 2017-03-21 12:47:30 +08:00
parent a147cca72c
commit 6d238496e8
7 changed files with 16 additions and 27 deletions

View File

@ -22,12 +22,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='senlinclient')
# 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

View File

@ -26,7 +26,6 @@ from oslo_utils import strutils
import six
from senlinclient.common.i18n import _
from senlinclient.common.i18n import _LI
from senlinclient.common import utils as senlin_utils
@ -312,10 +311,10 @@ class DeleteCluster(command.Command):
if not prompt_response.startswith('y'):
return
except KeyboardInterrupt: # Ctrl-c
self.log.info(_LI('Ctrl-c detected.'))
self.log.info('Ctrl-c detected.')
return
except EOFError: # Ctrl-d
self.log.info(_LI('Ctrl-d detected'))
self.log.info('Ctrl-d detected')
return
result = {}

View File

@ -23,7 +23,6 @@ from oslo_utils import strutils
import six
from senlinclient.common.i18n import _
from senlinclient.common.i18n import _LI
from senlinclient.common import utils as senlin_utils
@ -315,10 +314,10 @@ class DeleteNode(command.Command):
if not prompt_response.startswith('y'):
return
except KeyboardInterrupt: # Ctrl-c
self.log.info(_LI('Ctrl-c detected.'))
self.log.info('Ctrl-c detected.')
return
except EOFError: # Ctrl-d
self.log.info(_LI('Ctrl-d detected'))
self.log.info('Ctrl-d detected')
return
result = {}

View File

@ -20,7 +20,7 @@ from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
from senlinclient.common.i18n import _, _LI
from senlinclient.common.i18n import _
from senlinclient.common import utils as senlin_utils
@ -254,10 +254,10 @@ class DeletePolicy(command.Command):
if not prompt_response.startswith('y'):
return
except KeyboardInterrupt: # Ctrl-c
self.log.info(_LI('Ctrl-c detected.'))
self.log.info('Ctrl-c detected.')
return
except EOFError: # Ctrl-d
self.log.info(_LI('Ctrl-d detected'))
self.log.info('Ctrl-d detected')
return
failure_count = 0

View File

@ -20,7 +20,7 @@ from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
from senlinclient.common.i18n import _, _LI
from senlinclient.common.i18n import _
from senlinclient.common import utils as senlin_utils
@ -190,10 +190,10 @@ class DeleteProfile(command.Command):
if not prompt_response.startswith('y'):
return
except KeyboardInterrupt: # Ctrl-c
self.log.info(_LI('Ctrl-c detected.'))
self.log.info('Ctrl-c detected.')
return
except EOFError: # Ctrl-d
self.log.info(_LI('Ctrl-d detected'))
self.log.info('Ctrl-d detected')
return
failure_count = 0

View File

@ -20,7 +20,7 @@ from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
from senlinclient.common.i18n import _, _LI
from senlinclient.common.i18n import _
from senlinclient.common import utils as senlin_utils
@ -246,10 +246,10 @@ class DeleteReceiver(command.Command):
if not prompt_response.startswith('y'):
return
except KeyboardInterrupt: # Ctrl-c
self.log.info(_LI('Ctrl-c detected.'))
self.log.info('Ctrl-c detected.')
return
except EOFError: # Ctrl-d
self.log.info(_LI('Ctrl-d detected'))
self.log.info('Ctrl-d detected')
return
failure_count = 0

View File

@ -20,7 +20,7 @@ from oslo_utils import strutils
import six
from senlinclient.common import exc
from senlinclient.common.i18n import _, _LW
from senlinclient.common.i18n import _
from senlinclient.common import utils
logger = logging.getLogger(__name__)
@ -28,8 +28,8 @@ logger = logging.getLogger(__name__)
def show_deprecated(deprecated, recommended):
logger.warning(
_LW('"%(old)s" is deprecated and will be removed by Apr 2017, '
'please use "%(new)s" instead.'),
('"%(old)s" is deprecated and will be removed by Apr 2017, '
'please use "%(new)s" instead.'),
{'old': deprecated, 'new': recommended})