for rem, roles in zip(remotes, ctx.config['roles']):
ctx.cluster.add(rem, roles)
+ ctx.summary = {}
+
+ from teuthology.run_tasks import run_tasks
try:
- summary = {}
- from teuthology.run_tasks import run_tasks
- run_tasks(tasks=ctx.config['tasks'], ctx=ctx, summary=summary)
+ run_tasks(tasks=ctx.config['tasks'], ctx=ctx)
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)
+ yaml.safe_dump(ctx.summary, f, default_flow_style=False)
fn = getattr(mod, subtask)
return fn(**kwargs)
-def run_tasks(tasks, ctx, summary):
+def run_tasks(tasks, ctx):
stack = []
try:
for taskdict in tasks:
manager.__enter__()
stack.append(manager)
except:
- summary['success'] = False
+ ctx.summary['success'] = False
log.exception('Saw exception from tasks')
finally:
try:
try:
suppress = manager.__exit__(*exc_info)
except:
- summary['success'] = False
+ ctx.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
+ ctx.summary.setdefault('success', True)