nova/nova/notifications
Stephen Finucane 125df26bf9 Use 'Exception.__traceback__' for versioned notifications
The 'inspect.trace()' function is expected to be called within the
context of an exception handler. The 'from_exc_and_traceback' class
method of the 'nova.notification.objects.exception.ExceptionPayload'
class uses this to get information about a provided exception, however,
there are cases where this is called from outside of an exception
handler. In these cases, we see an 'IndexError' since we can't get the
last frame of a non-existent stacktrace. The solution to this is to
fallback to using the traceback embedded in the exception. This is a bit
lossy when decorators are involved but for all other cases this will
give us the same information. This also allows us to avoid passing a
traceback argument to the function since we have it to hand already.

Change-Id: I404ca316b1bf2a963106cd34e927934befbd9b12
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #1881455
2020-06-08 14:38:33 +01:00
..
objects Use 'Exception.__traceback__' for versioned notifications 2020-06-08 14:38:33 +01:00
__init__.py Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
base.py Remove 'nova.image.api' module 2020-02-18 11:45:39 +00:00