Skip to content

Commit

Permalink
teuthology/run_tasks.py: Add more loggings
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kamoltat committed Sep 26, 2022
1 parent a773b06 commit 8bcb607
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion teuthology/run_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8bcb607

Please sign in to comment.