From: John Spray Date: Wed, 2 Jul 2014 18:09:03 +0000 (+0100) Subject: run_tasks: catch malformed task case X-Git-Tag: v0.94.10~27^2^2~364^2~51^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=87383048d6e227dd7ad68cdd40fa2804e836dae5;p=ceph.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 99158ff2cdc3..ada99d025679 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)