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: Icbfc8958fe430fdd42a569819a8221a32ab681a5
This commit is contained in:
Duan Jiong 2017-03-21 12:52:23 +08:00
parent 6b429b3278
commit 4bf3df40ee
4 changed files with 7 additions and 25 deletions

View File

@ -17,7 +17,7 @@ DOMAIN = 'neutronclient'
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
# The primary translation function using the well-known name "_"
# The translation function using the well-known name "_"
_ = _translators.primary
# The contextual translation function using the name "_C"
@ -26,16 +26,6 @@ _C = _translators.contextual_form
# The plural translation function using the name "_P"
_P = _translators.plural_form
# 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
def get_available_languages():
return oslo_i18n.get_available_languages(DOMAIN)

View File

@ -21,7 +21,3 @@ message = ("moved to neutronclient._i18n; please migrate to local "
"http://docs.openstack.org/developer/oslo.i18n/usage.html")
_ = moves.moved_function(_i18n._, '_', __name__, message=message)
_LC = moves.moved_function(_i18n._LC, '_LC', __name__, message=message)
_LE = moves.moved_function(_i18n._LE, '_LE', __name__, message=message)
_LW = moves.moved_function(_i18n._LW, '_LW', __name__, message=message)
_LI = moves.moved_function(_i18n._LI, '_LI', __name__, message=message)

View File

@ -22,8 +22,6 @@ from osc_lib import exceptions
from osc_lib import utils as osc_utils
from neutronclient._i18n import _
from neutronclient._i18n import _LE
from neutronclient._i18n import _LW
from neutronclient.osc import utils as nc_osc_utils
from neutronclient.osc.v2.networking_bgpvpn import constants
@ -311,11 +309,11 @@ class DeleteBgpvpn(command.Command):
try:
id = client.find_resource(constants.BGPVPN, id_or_name)['id']
client.delete_bgpvpn(id)
LOG.warning(_LW("BGP VPN %(id)s deleted"), {'id': id})
LOG.warning("BGP VPN %(id)s deleted", {'id': id})
except Exception as e:
fails += 1
LOG.error(_LE("Failed to delete BGP VPN with name or ID "
"'%(id_or_name)s': %(e)s"),
LOG.error("Failed to delete BGP VPN with name or ID "
"'%(id_or_name)s': %(e)s",
{'id_or_name': id_or_name, 'e': e})
if fails > 0:
msg = (_("Failed to delete %(fails)s of %(total)s BGP VPN.") %

View File

@ -21,8 +21,6 @@ from osc_lib import exceptions
from osc_lib import utils as osc_utils
from neutronclient._i18n import _
from neutronclient._i18n import _LE
from neutronclient._i18n import _LW
from neutronclient.osc import utils as nc_osc_utils
from neutronclient.osc.v2.networking_bgpvpn import constants
@ -105,13 +103,13 @@ class DeleteBgpvpnResAssoc(command.Command):
try:
delete_method(bgpvpn['id'], id)
LOG.warning(
_LW("%(assoc_res_name)s association %(id)s deleted"),
"%(assoc_res_name)s association %(id)s deleted",
{'assoc_res_name': self._assoc_res_name.capitalize(),
'id': id})
except Exception as e:
fails += 1
LOG.error(_LE("Failed to delete %(assoc_res_name)s "
"association with ID '%(id)s': %(e)s"),
LOG.error("Failed to delete %(assoc_res_name)s "
"association with ID '%(id)s': %(e)s",
{'assoc_res_name': self._assoc_res_name,
'id': id,
'e': e})