Don't translate exceptions
All our exceptions so far don't seem to be messages we ever intentionally want shown to a user.
This commit is contained in:
parent
23c566e3e2
commit
2ba5a6a1be
|
@ -98,7 +98,7 @@ class FakeDriver(base.BaseDriver):
|
|||
def send(self, target, ctxt, message,
|
||||
wait_for_reply=None, timeout=None, envelope=False):
|
||||
if not target.topic:
|
||||
raise InvalidTarget(_('A topic is required to send'), target)
|
||||
raise InvalidTarget('A topic is required to send', target)
|
||||
|
||||
# FIXME(markmc): preconditions to enforce:
|
||||
# - timeout and not wait_for_reply
|
||||
|
@ -120,7 +120,7 @@ class FakeDriver(base.BaseDriver):
|
|||
|
||||
if timeout and (time.time() - start_time > timeout):
|
||||
raise messaging.MessagingTimeout(
|
||||
_('No listeners found for topic %s') % target.topic)
|
||||
'No listeners found for topic %s' % target.topic)
|
||||
|
||||
time.sleep(.05)
|
||||
|
||||
|
@ -137,14 +137,14 @@ class FakeDriver(base.BaseDriver):
|
|||
|
||||
def listen(self, target):
|
||||
if not (target.topic and target.server):
|
||||
raise InvalidTarget(_('Topic and server are required to listen'),
|
||||
raise InvalidTarget('Topic and server are required to listen',
|
||||
target)
|
||||
|
||||
exchange = target.exchange or self._default_exchange
|
||||
topics = self._exchanges.setdefault(exchange, {})
|
||||
|
||||
if target.topic in topics:
|
||||
raise InvalidTarget(_('Already listening on this topic'), target)
|
||||
raise InvalidTarget('Already listening on this topic', target)
|
||||
|
||||
listener = FakeListener(self, target)
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ def parse_url(url, default_exchange=None):
|
|||
|
||||
# NOTE(flaper87): Not PY3K compliant
|
||||
if not isinstance(url, basestring):
|
||||
raise TypeError(_("Wrong URL type"))
|
||||
raise TypeError("Wrong URL type")
|
||||
|
||||
url = urlparse.urlparse(url)
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import inspect
|
|||
|
||||
from oslo.config import cfg
|
||||
|
||||
from openstack.common.gettextutils import _
|
||||
from openstack.common import local
|
||||
from openstack.common import log as logging
|
||||
from openstack.common.messaging import _utils as utils
|
||||
|
@ -42,8 +41,8 @@ class RpcVersionCapError(Exception):
|
|||
self.version_cap = version_cap
|
||||
|
||||
def __str__(self):
|
||||
return (_("Specified RPC version cap, %(version_cap)s, is too low. "
|
||||
"Needs to be higher than %(version)s.") %
|
||||
return ("Specified RPC version cap, %(version_cap)s, is too low. "
|
||||
"Needs to be higher than %(version)s." %
|
||||
dict(version=self.version, version_cap=self.version_cap))
|
||||
|
||||
|
||||
|
@ -88,9 +87,9 @@ class _CallContext(object):
|
|||
if ((hasattr(local.strong_store, 'locks_held') and
|
||||
local.strong_store.locks_held)):
|
||||
stack = ' :: '.join([frame[3] for frame in inspect.stack()])
|
||||
_LOG.warn(_('An RPC is being made while holding a lock. The locks '
|
||||
'currently held are %(locks)s. This is probably a bug. '
|
||||
'Please report it. Include the following: [%(stack)s].'),
|
||||
_LOG.warn('An RPC is being made while holding a lock. The locks '
|
||||
'currently held are %(locks)s. This is probably a bug. '
|
||||
'Please report it. Include the following: [%(stack)s].',
|
||||
{'locks': local.strong_store.locks_held, 'stack': stack})
|
||||
|
||||
def _check_version_cap(self, version):
|
||||
|
|
Loading…
Reference in New Issue