Rework exception handling on deploy failures in conductor
Currently on unexpected python error we only log the error message, e.g.
"NoneType object is not iterable" or just KeyError missing key. This is
obviously not helping debugging too much.
This change splits error handling into separate handling of IronicException
and other exceptions.
For IronicException: only log the error message, remove redundant "Error: "
from the last_error message.
For other exceptions: log traceback, mention that the exception was not
expected.
Finally, move logging to the top of the error handling helper to make sure
it never gets lost.
Reviewed: https:/ /review. openstack. org/531120 /git.openstack. org/cgit/ openstack/ ironic/ commit/ ?id=2b5849b49e2 4f310b7cf7f7c2e 9a8b14f11da2a7
Committed: https:/
Submitter: Zuul
Branch: master
commit 2b5849b49e24f31 0b7cf7f7c2e9a8b 14f11da2a7
Author: Dmitry Tantsur <email address hidden>
Date: Thu Jan 4 11:10:18 2018 +0100
Rework exception handling on deploy failures in conductor
Currently on unexpected python error we only log the error message, e.g.
"NoneType object is not iterable" or just KeyError missing key. This is
obviously not helping debugging too much.
This change splits error handling into separate handling of IronicException
and other exceptions.
For IronicException: only log the error message, remove redundant "Error: "
from the last_error message.
For other exceptions: log traceback, mention that the exception was not
expected.
Finally, move logging to the top of the error handling helper to make sure
it never gets lost.
Change-Id: Idc2339c3bdad80 92907d9651d40f2 41a2ae50dbe
Related-Bug: #1741223