for rem, roles in zip(remotes, ctx.config['roles']):
ctx.cluster.add(rem, roles)
- from teuthology.run_tasks import run_tasks
- run_tasks(tasks=ctx.config['tasks'], ctx=ctx)
+ try:
+ summary = {}
+ from teuthology.run_tasks import run_tasks
+ run_tasks(tasks=ctx.config['tasks'], ctx=ctx, summary=summary)
+ finally:
+ if ctx.archive is not None:
+ with file(os.path.join(ctx.archive, 'summary.yaml'), 'w') as f:
+ yaml.safe_dump(summary, f, default_flow_style=False)
fn = getattr(mod, 'task')
return fn(**kwargs)
-def run_tasks(tasks, ctx):
+def run_tasks(tasks, ctx, summary):
stack = []
try:
for taskdict in tasks:
manager.__enter__()
stack.append(manager)
except:
+ summary['success'] = False
log.exception('Saw exception from tasks')
finally:
try:
try:
suppress = manager.__exit__(*exc_info)
except:
+ summary['success'] = False
log.exception('Manager failed: %s', manager)
else:
if suppress:
finally:
# be careful about cyclic references
del exc_info
+ if 'success' not in summary:
+ summary['success'] = True