Merge "Fix: "raise" issues for Python 2/3 compatible code."
This commit is contained in:
commit
ded5fe6cbc
|
@ -23,6 +23,7 @@ import contextlib
|
|||
import logging
|
||||
import sys
|
||||
import traceback
|
||||
import six
|
||||
|
||||
from sysinv.openstack.common.gettextutils import _
|
||||
|
||||
|
@ -48,4 +49,4 @@ def save_and_reraise_exception():
|
|||
logging.error(_('Original exception being dropped: %s'),
|
||||
traceback.format_exception(type_, value, tb))
|
||||
raise
|
||||
raise type_, value, tb
|
||||
six.reraise(type_, value, tb)
|
||||
|
|
|
@ -26,6 +26,7 @@ import json
|
|||
import time
|
||||
|
||||
import eventlet
|
||||
import six
|
||||
|
||||
from sysinv.openstack.common.rpc import common as rpc_common
|
||||
|
||||
|
@ -69,7 +70,7 @@ class Consumer(object):
|
|||
# Caller might have called ctxt.reply() manually
|
||||
for (reply, failure) in ctxt._response:
|
||||
if failure:
|
||||
raise failure[0], failure[1], failure[2]
|
||||
six.reraise(failure[0], failure[1], failure[2])
|
||||
res.append(reply)
|
||||
# if ending not 'sent'...we might have more data to
|
||||
# return from the function itself
|
||||
|
|
Loading…
Reference in New Issue