Make code follow log translation guideline

Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
This commit is contained in:
Inessa Vasilevskaya
2017-04-04 19:14:12 +03:00
committed by Akihiro Motoki
parent c65e541b6e
commit 7322bd6efb
157 changed files with 1270 additions and 1391 deletions

View File

@@ -21,7 +21,6 @@ from oslo_log import log as logging
import webob.dec
import webob.exc
from neutron._i18n import _LE, _LI
from neutron.api import api_common
from neutron.common import utils
from neutron import wsgi
@@ -101,16 +100,15 @@ def Resource(controller, faults=None, deserializers=None, serializers=None,
mapped_exc = api_common.convert_exception_to_http_exc(e, faults,
language)
if hasattr(mapped_exc, 'code') and 400 <= mapped_exc.code < 500:
LOG.info(_LI('%(action)s failed (client error): %(exc)s'),
LOG.info('%(action)s failed (client error): %(exc)s',
{'action': action, 'exc': mapped_exc})
else:
LOG.exception(
_LE('%(action)s failed: %(details)s'),
{
'action': action,
'details': utils.extract_exc_details(e),
}
)
LOG.exception('%(action)s failed: %(details)s',
{
'action': action,
'details': utils.extract_exc_details(e),
}
)
raise mapped_exc
status = action_status.get(action, 200)