From d8219996291ce7dfcb386b55f4f4e72ece7250d0 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sun, 16 Jun 2013 11:55:47 +0100 Subject: [PATCH] Don't translate exception messages --- oslo/messaging/_executors/base.py | 3 +-- oslo/messaging/notify/_impl_messaging.py | 5 ++--- oslo/messaging/notify/notifier.py | 7 +++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/oslo/messaging/_executors/base.py b/oslo/messaging/_executors/base.py index 5d131e9f6..1545b6016 100644 --- a/oslo/messaging/_executors/base.py +++ b/oslo/messaging/_executors/base.py @@ -15,7 +15,6 @@ import abc import sys -from oslo.messaging.openstack.common.gettextutils import _ from oslo.messaging.openstack.common import log as logging _LOG = logging.getLogger(__name__) @@ -38,7 +37,7 @@ class ExecutorBase(object): except Exception: # sys.exc_info() is deleted by LOG.exception(). exc_info = sys.exc_info() - _LOG.error(_("Failed to process message... skipping it."), + _LOG.error("Failed to process message... skipping it.", exc_info=exc_info) incoming.reply(failure=exc_info) finally: diff --git a/oslo/messaging/notify/_impl_messaging.py b/oslo/messaging/notify/_impl_messaging.py index f6ba8803d..aec31a891 100644 --- a/oslo/messaging/notify/_impl_messaging.py +++ b/oslo/messaging/notify/_impl_messaging.py @@ -17,7 +17,6 @@ from oslo import messaging from oslo.messaging.notify import notifier -from oslo.messaging.openstack.common.gettextutils import _ from oslo.messaging.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -36,8 +35,8 @@ class MessagingDriver(notifier._Driver): self.transport._send(target, context, message, envelope=self.envelope) except Exception: - LOG.exception(_("Could not send notification to %(topic)s. " - "Payload=%(message)s"), + LOG.exception("Could not send notification to %(topic)s. " + "Payload=%(message)s", dict(topic=topic, message=message)) diff --git a/oslo/messaging/notify/notifier.py b/oslo/messaging/notify/notifier.py index 62eb28b6d..c60cfeb7a 100644 --- a/oslo/messaging/notify/notifier.py +++ b/oslo/messaging/notify/notifier.py @@ -21,7 +21,6 @@ from oslo.config import cfg from stevedore import named from oslo import messaging -from oslo.messaging.openstack.common.gettextutils import _ from oslo.messaging.openstack.common import log as logging from oslo.messaging.openstack.common import timeutils from oslo.messaging.openstack.common import uuidutils @@ -93,9 +92,9 @@ class Notifier(object): try: ext.obj.notify(context, msg, priority) except Exception as e: - LOG.exception(_("Problem '%(e)s' attempting to send to " - "notification system. Payload=%(payload)s") - % dict(e=e, payload=payload)) + LOG.exception("Problem '%(e)s' attempting to send to " + "notification system. Payload=%(payload)s", + dict(e=e, payload=payload)) self._driver_mgr.map(do_notify) def debug(self, context, event_type, payload):