diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-29 23:06:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-29 23:06:13 +0000 |
| commit | 1fd7694e96da4c7e461d3c966fab1e81ee57c315 (patch) | |
| tree | f19487d48afc96acd72dc7bb95bb951e0fc229a2 /openstack | |
| parent | cd176d1147b19547fe4deb3299216aeaa1ca535b (diff) | |
| parent | 6d102bcf0cbacb1d37eec20c4d318e14724a056d (diff) | |
| download | oslo-1fd7694e96da4c7e461d3c966fab1e81ee57c315.tar.gz oslo-1fd7694e96da4c7e461d3c966fab1e81ee57c315.tar.xz oslo-1fd7694e96da4c7e461d3c966fab1e81ee57c315.zip | |
Merge "Provide i18n to those messages without _()"
Diffstat (limited to 'openstack')
| -rw-r--r-- | openstack/common/exception.py | 4 | ||||
| -rw-r--r-- | openstack/common/excutils.py | 6 | ||||
| -rw-r--r-- | openstack/common/rpc/amqp.py | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/openstack/common/exception.py b/openstack/common/exception.py index 4866de2..fa06d6a 100644 --- a/openstack/common/exception.py +++ b/openstack/common/exception.py @@ -21,6 +21,8 @@ Exceptions common to OpenStack projects import logging +from openstack.common.gettextutils import _ + class Error(Exception): def __init__(self, message=None): @@ -97,7 +99,7 @@ def wrap_exception(f): except Exception, e: if not isinstance(e, Error): #exc_type, exc_value, exc_traceback = sys.exc_info() - logging.exception('Uncaught exception') + logging.exception(_('Uncaught exception')) #logging.error(traceback.extract_stack(exc_traceback)) raise Error(str(e)) raise diff --git a/openstack/common/excutils.py b/openstack/common/excutils.py index 5dd4830..c518310 100644 --- a/openstack/common/excutils.py +++ b/openstack/common/excutils.py @@ -24,6 +24,8 @@ import logging import sys import traceback +from openstack.common.gettextutils import _ + @contextlib.contextmanager def save_and_reraise_exception(): @@ -43,7 +45,7 @@ def save_and_reraise_exception(): try: yield except Exception: - logging.error('Original exception being dropped: %s' % - (traceback.format_exception(type_, value, tb))) + logging.error(_('Original exception being dropped: %s'), + traceback.format_exception(type_, value, tb)) raise raise type_, value, tb diff --git a/openstack/common/rpc/amqp.py b/openstack/common/rpc/amqp.py index 2ea506a..b247106 100644 --- a/openstack/common/rpc/amqp.py +++ b/openstack/common/rpc/amqp.py @@ -55,7 +55,7 @@ class Pool(pools.Pool): # TODO(comstud): Timeout connections not used in a while def create(self): - LOG.debug('Pool creating new connection') + LOG.debug(_('Pool creating new connection')) return self.connection_cls(self.conf) def empty(self): @@ -283,7 +283,7 @@ class ProxyCallback(object): # This final None tells multicall that it is done. ctxt.reply(ending=True, connection_pool=self.connection_pool) except Exception: - LOG.exception('Exception during message handling') + LOG.exception(_('Exception during message handling')) ctxt.reply(None, sys.exc_info(), connection_pool=self.connection_pool) |
