From 8bcb6077f51c837c4cfad9fb3e59b7f2f26ad4ec Mon Sep 17 00:00:00 2001 From: Kamoltat Sirivadhna Date: Mon, 26 Sep 2022 10:20:04 -0400 Subject: [PATCH] teuthology/run_tasks.py: Add more loggings Add more logging for debuging purposes and add exceptions to make trouble shooting easier. Fixes: https://tracker.ceph.com/issues/54372 Signed-off-by: Kamoltat Sirivadhna --- teuthology/run_tasks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index 598947c807..ad1407a9c6 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -29,9 +29,17 @@ def get_task(name): # First look for the tasks's module inside teuthology module = _import('teuthology.task', module_name, task_name) + log.info("importing module_name: {} and task_name: {}".format( + module_name, + task_name, + )) # If it is not found, try qa/ directory (if it is in sys.path) if not module: - module = _import('tasks', module_name, task_name, fail_on_import_error=True) + try: + module = _import('tasks', module_name, task_name, fail_on_import_error=True) + except Exception as e: + log.error('An exception occurred: {}'.format(e)) + raise try: # Attempt to locate the task object inside the module task = getattr(module, task_name)