From d9619c9323eb18975d555b7c4a24acba6deb306f Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 2 Sep 2021 13:02:43 -0400 Subject: [PATCH] Include an exception on outer-level failures when running plugins The traceback will be both in the debug output and within the Result value for the call so we have half a chance to fix what is broken. https://github.com/freeipa/freeipa-healthcheck/issues/224 Signed-off-by: Rob Crittenden --- src/ipahealthcheck/core/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ipahealthcheck/core/core.py b/src/ipahealthcheck/core/core.py index 020919f5..685dbd72 100644 --- a/src/ipahealthcheck/core/core.py +++ b/src/ipahealthcheck/core/core.py @@ -8,6 +8,7 @@ import pkg_resources import signal import warnings +import traceback from datetime import datetime @@ -61,7 +62,9 @@ def signal_handler(signum, frame): start=start) except Exception as e: logger.debug('Exception raised: %s', e) + logger.debug(traceback.format_exc()) yield Result(plugin, constants.CRITICAL, exception=str(e), + traceback=traceback.format_exc(), start=start) finally: signal.alarm(0)