From: Walter A. Boring IV Date: Wed, 25 Sep 2013 21:48:16 +0000 (-0700) Subject: Clean CONF out of brick exception X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ca1fa01c58b3cc9e374669a92febb467de0f9edd;p=openstack-build%2Fcinder-build.git Clean CONF out of brick exception This is part 3 of the work needed to remove CONF from the brick subproject. This patch removes the CONF usage in the brick exception. Fixes bug #1230066 Change-Id: Id1ad704a613bc7e2657a65407932a8ef3706bf92 --- diff --git a/cinder/brick/exception.py b/cinder/brick/exception.py index 6995923f6..33ccfb391 100644 --- a/cinder/brick/exception.py +++ b/cinder/brick/exception.py @@ -18,16 +18,12 @@ import sys -from oslo.config import cfg - from cinder.openstack.common.gettextutils import _ from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) -CONF = cfg.CONF - class BrickException(Exception): """Base Brick Exception @@ -58,15 +54,14 @@ class BrickException(Exception): exc_info = sys.exc_info() # kwargs doesn't match a variable in the message # log the issue and the kwargs - LOG.exception(_('Exception in string format operation')) + msg = (_("Exception in string format operation. msg='%s'") + % self.msg_fmt) + LOG.exception(msg) for name, value in kwargs.iteritems(): LOG.error("%s: %s" % (name, value)) - if CONF.fatal_exception_format_errors: - raise exc_info[0], exc_info[1], exc_info[2] - else: - # at least get the core message out if something happened - message = self.msg_fmt + # at least get the core message out if something happened + message = self.msg_fmt super(BrickException, self).__init__(message)