]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Clean CONF out of brick exception
authorWalter A. Boring IV <walter.boring@hp.com>
Wed, 25 Sep 2013 21:48:16 +0000 (14:48 -0700)
committerWalter A. Boring IV <walter.boring@hp.com>
Wed, 25 Sep 2013 21:48:16 +0000 (14:48 -0700)
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

cinder/brick/exception.py

index 6995923f63549c0b33305337f621de7abbcf4d88..33ccfb391458e4435b7a2203dd1c008acc780d69 100644 (file)
 
 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)