From: John Spray Date: Wed, 2 Jul 2014 18:09:03 +0000 (+0100) Subject: run_tasks: catch malformed task case X-Git-Tag: 1.1.0~1341^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=87383048d6e227dd7ad68cdd40fa2804e836dae5;p=teuthology.git run_tasks: catch malformed task case If you do something like this: - foo: - bar: - baz Then catching AttributeError is necessary for giving a somewhat friendlier error on the 'baz' where we have a string instead of a dict. Signed-off-by: John Spray --- diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index 99158ff2cd..ada99d0256 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -37,7 +37,7 @@ def run_tasks(tasks, ctx): for taskdict in tasks: try: ((taskname, config),) = taskdict.iteritems() - except ValueError: + except (ValueError, AttributeError): raise RuntimeError('Invalid task definition: %s' % taskdict) log.info('Running task %s...', taskname) manager = run_one_task(taskname, ctx=ctx, config=config)