LOG.error(_LE("%(name)s: %(value)s"),
{'name': name, 'value': value})
if CONF.fatal_exception_format_errors:
- raise exc_info[0], exc_info[1], exc_info[2]
+ six.reraise(*exc_info)
# at least get the core message out if something happened
message = self.message
elif isinstance(message, Exception):
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import timeutils
+import six
from six.moves import urllib
from cinder import exception
"""Transform the exception for the image but keep its traceback intact."""
_exc_type, exc_value, exc_trace = sys.exc_info()
new_exc = _translate_image_exception(image_id, exc_value)
- raise new_exc, None, exc_trace
+ six.reraise(new_exc, None, exc_trace)
def _reraise_translated_exception():
"""Transform the exception but keep its traceback intact."""
_exc_type, exc_value, exc_trace = sys.exc_info()
new_exc = _translate_plain_exception(exc_value)
- raise new_exc, None, exc_trace
+ six.reraise(new_exc, None, exc_trace)
def _translate_image_exception(image_id, exc_value):
if e.code == '13115' or e.code == '9016':
pass
else:
- raise exc_info[0], exc_info[1], exc_info[2]
+ six.reraise(*exc_info)
def create_igroup(self, igroup, igroup_type='iscsi', os_type='default'):
"""Creates igroup with specified args."""