From a3a0568d74bc25e59783873d3b0ae192ad682206 Mon Sep 17 00:00:00 2001 From: Chris Doyle Date: Sun, 3 Mar 2024 21:44:43 +0000 Subject: [PATCH] chore: Logs the import exception in the python provider when a module fails to import. This is to help aid debugging the underlying cause as raised in issue #271 Signed-off-by: Chris Doyle --- chaoslib/provider/python.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chaoslib/provider/python.py b/chaoslib/provider/python.py index 56fea50..1553201 100644 --- a/chaoslib/provider/python.py +++ b/chaoslib/provider/python.py @@ -88,7 +88,8 @@ def validate_python_activity(activity: Activity): # noqa: C901 try: mod = importlib.import_module(mod_name) - except ImportError: + except ImportError as ie: + logger.exception(ie) raise InvalidActivity( "could not find Python module '{mod}' " "in activity '{name}'".format(mod=mod_name, name=activity_name)