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: Ia1c55fc10a10b03baa43779e1f5648ce62e91c14 Closes-Bug: 1674577
This commit is contained in:
parent
6e04f882c4
commit
824adacdfc
@ -25,13 +25,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='oslo_utils')
|
|||||||
|
|
||||||
# The primary translation function using the well-known name "_"
|
# The primary translation function using the well-known name "_"
|
||||||
_ = _translators.primary
|
_ = _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
|
|
||||||
|
@ -26,7 +26,7 @@ import traceback
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from oslo_utils._i18n import _LE
|
|
||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
from oslo_utils import reflection
|
from oslo_utils import reflection
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
@ -211,7 +211,7 @@ class save_and_reraise_exception(object):
|
|||||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
if exc_type is not None:
|
if exc_type is not None:
|
||||||
if self.reraise:
|
if self.reraise:
|
||||||
self.logger.error(_LE('Original exception being dropped: %s'),
|
self.logger.error('Original exception being dropped: %s',
|
||||||
traceback.format_exception(self.type_,
|
traceback.format_exception(self.type_,
|
||||||
self.value,
|
self.value,
|
||||||
self.tb))
|
self.tb))
|
||||||
@ -258,8 +258,8 @@ def forever_retry_uncaught_exceptions(*args, **kwargs):
|
|||||||
# The watch has expired or the exception message
|
# The watch has expired or the exception message
|
||||||
# changed, so time to log it again...
|
# changed, so time to log it again...
|
||||||
logging.exception(
|
logging.exception(
|
||||||
_LE('Unexpected exception occurred %d time(s)... '
|
'Unexpected exception occurred %d time(s)... '
|
||||||
'retrying.') % same_failure_count)
|
'retrying.' % same_failure_count)
|
||||||
if not watch.has_started():
|
if not watch.has_started():
|
||||||
watch.start()
|
watch.start()
|
||||||
else:
|
else:
|
||||||
|
@ -28,8 +28,7 @@ import six
|
|||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from oslo_utils._i18n import _
|
from oslo_utils._i18n import _
|
||||||
from oslo_utils._i18n import _LI
|
|
||||||
from oslo_utils._i18n import _LW
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
_IS_IPV6_ENABLED = None
|
_IS_IPV6_ENABLED = None
|
||||||
@ -330,19 +329,19 @@ def _get_my_ipv4_address():
|
|||||||
try:
|
try:
|
||||||
interface = gtw['default'][netifaces.AF_INET][1]
|
interface = gtw['default'][netifaces.AF_INET][1]
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
LOG.info(_LI('Could not determine default network interface, '
|
LOG.info('Could not determine default network interface, '
|
||||||
'using 127.0.0.1 for IPv4 address'))
|
'using 127.0.0.1 for IPv4 address')
|
||||||
return LOCALHOST
|
return LOCALHOST
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr']
|
return netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr']
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
LOG.info(_LI('Could not determine IPv4 address for interface %s, '
|
LOG.info('Could not determine IPv4 address for interface %s, '
|
||||||
'using 127.0.0.1'),
|
'using 127.0.0.1',
|
||||||
interface)
|
interface)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.info(_LI('Could not determine IPv4 address for '
|
LOG.info('Could not determine IPv4 address for '
|
||||||
'interface %(interface)s: %(error)s'),
|
'interface %(interface)s: %(error)s',
|
||||||
{'interface': interface, 'error': e})
|
{'interface': interface, 'error': e})
|
||||||
return LOCALHOST
|
return LOCALHOST
|
||||||
|
|
||||||
@ -437,18 +436,18 @@ def set_tcp_keepalive(sock, tcp_keepalive=True,
|
|||||||
socket.TCP_KEEPIDLE,
|
socket.TCP_KEEPIDLE,
|
||||||
tcp_keepidle)
|
tcp_keepidle)
|
||||||
else:
|
else:
|
||||||
LOG.warning(_LW('tcp_keepidle not available on your system'))
|
LOG.warning('tcp_keepidle not available on your system')
|
||||||
if tcp_keepalive_interval is not None:
|
if tcp_keepalive_interval is not None:
|
||||||
if hasattr(socket, 'TCP_KEEPINTVL'):
|
if hasattr(socket, 'TCP_KEEPINTVL'):
|
||||||
sock.setsockopt(socket.IPPROTO_TCP,
|
sock.setsockopt(socket.IPPROTO_TCP,
|
||||||
socket.TCP_KEEPINTVL,
|
socket.TCP_KEEPINTVL,
|
||||||
tcp_keepalive_interval)
|
tcp_keepalive_interval)
|
||||||
else:
|
else:
|
||||||
LOG.warning(_LW('tcp_keepintvl not available on your system'))
|
LOG.warning('tcp_keepintvl not available on your system')
|
||||||
if tcp_keepalive_count is not None:
|
if tcp_keepalive_count is not None:
|
||||||
if hasattr(socket, 'TCP_KEEPCNT'):
|
if hasattr(socket, 'TCP_KEEPCNT'):
|
||||||
sock.setsockopt(socket.IPPROTO_TCP,
|
sock.setsockopt(socket.IPPROTO_TCP,
|
||||||
socket.TCP_KEEPCNT,
|
socket.TCP_KEEPCNT,
|
||||||
tcp_keepalive_count)
|
tcp_keepalive_count)
|
||||||
else:
|
else:
|
||||||
LOG.warning(_LW('tcp_keepcnt not available on your system'))
|
LOG.warning('tcp_keepcnt not available on your system')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user