]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Provide real error messages for unfound (sub)tasks
authorZack Cerza <zack@cerza.org>
Mon, 31 Mar 2014 14:57:19 +0000 (09:57 -0500)
committerZack Cerza <zack@cerza.org>
Mon, 31 Mar 2014 14:57:19 +0000 (09:57 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/run_tasks.py

index 0796c304c674440d5b40954451bfd2504e2e5495..84936b355afc64573369d20294ecb8552e8040d6 100644 (file)
@@ -14,8 +14,16 @@ def run_one_task(taskname, **kwargs):
     if '.' in taskname:
         (submod, subtask) = taskname.rsplit('.', 1)
     parent = __import__('teuthology.task', globals(), locals(), [submod], 0)
-    mod = getattr(parent, submod)
-    fn = getattr(mod, subtask)
+    try:
+        mod = getattr(parent, submod)
+    except AttributeError:
+        log.error("No task named %s was found", submod)
+        raise
+    try:
+        fn = getattr(mod, subtask)
+    except AttributeError:
+        log.error("No subtask of %s named %s was found", mod, subtask)
+        raise
     return fn(**kwargs)