From 6d102bcf0cbacb1d37eec20c4d318e14724a056d Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 28 Nov 2012 23:33:01 -0500 Subject: Provide i18n to those messages without _() bug 1081498 There are a few log messages without _(), but a lot messages with _(). Wrap these log messages with _() in order to make the code consistent. fix missing imports for _ Pass the log message and interpolation argument(s) to the logger separately remove extra parens rework the patch against latest trunk Change-Id: Ib0a7b0f9c57aadfbc2cfc477c6123b885c9c6060 --- openstack/common/exception.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openstack/common/exception.py') 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 -- cgit