From 83a5ab19b06b01c559d1839405327ffc84533cc9 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 29 Aug 2013 14:07:13 -0500 Subject: [PATCH] Pretty-up write_initial_metadata; s/run/name/ --- teuthology/run.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 1baa627748..53a4ab92c7 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -128,6 +128,15 @@ def write_initial_metadata(ctx): with file(os.path.join(ctx.archive, 'orig.config.yaml'), 'w') as f: yaml.safe_dump(ctx.config, f, default_flow_style=False) + info = { + 'name': ctx.name, + 'description': ctx.description, + 'owner': ctx.owner, + 'pid': os.getpid(), + } + with file(os.path.join(ctx.archive, 'info.yaml'), 'w') as f: + yaml.safe_dump(info, f, default_flow_style=False) + def main(): from gevent import monkey @@ -144,14 +153,6 @@ def main(): ctx.owner = get_user() write_initial_metadata(ctx) - if ctx.archive is not None: - info = {} - info['pid'] = os.getpid(); - info['description'] = ctx.description; - info['run'] = ctx.name; - info['owner'] = ctx.owner; - with file(os.path.join(ctx.archive, 'info.yaml'), 'w') as f: - yaml.safe_dump(info, f, default_flow_style=False) log.debug('test') raise RuntimeError('hi there') -- 2.39.5