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 <john.spray@redhat.com>
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)