From c8e1ec6a91a8b7a1fcc9a6b7e19f36a543601fd2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 20 Jun 2012 11:35:43 -0700 Subject: [PATCH] record owner at start of run So that we can clean up easily even when we don't finish and there is no summary.yaml. --- teuthology/run.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 8c9a20584d..40c62ebf20 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -96,6 +96,18 @@ def main(): from teuthology.misc import read_config read_config(ctx) + log.debug('\n '.join(['Config:', ] + yaml.safe_dump(ctx.config, default_flow_style=False).splitlines())) + + ctx.summary = dict(success=True) + + if ctx.owner is None: + from teuthology.misc import get_user + ctx.owner = get_user() + ctx.summary['owner'] = ctx.owner + + if ctx.description is not None: + ctx.summary['description'] = ctx.description + if ctx.archive is not None: os.mkdir(ctx.archive) @@ -112,17 +124,8 @@ def main(): with file(os.path.join(ctx.archive, 'pid'), 'w') as f: f.write('%d' % os.getpid()) - log.debug('\n '.join(['Config:', ] + yaml.safe_dump(ctx.config, default_flow_style=False).splitlines())) - - ctx.summary = dict(success=True) - - if ctx.owner is None: - from teuthology.misc import get_user - ctx.owner = get_user() - ctx.summary['owner'] = ctx.owner - - if ctx.description is not None: - ctx.summary['description'] = ctx.description + with file(os.path.join(ctx.archive, 'owner'), 'w') as f: + f.write(ctx.owner + '\n') for task in ctx.config['tasks']: assert 'kernel' not in task, \ -- 2.39.5