From: Tommi Virtanen Date: Wed, 15 Jun 2011 19:10:27 +0000 (-0700) Subject: Create the archive dir earlier, move out of ceph task. X-Git-Tag: v0.94.10~27^2^2~364^2~1733 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2bae22f0a375110ef17fd769c37dd8feb9a6c36c;p=ceph.git Create the archive dir earlier, move out of ceph task. --- diff --git a/teuthology/run.py b/teuthology/run.py index 1c983b1e7bcc..16a0caad9536 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -1,4 +1,5 @@ import argparse +import os import yaml def config_file(string): @@ -60,6 +61,12 @@ def main(): level=loglevel, ) + if ctx.archive is not None: + os.mkdir(ctx.archive) + + with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f: + yaml.safe_dump(ctx.config, f, default_flow_style=False) + log.debug('\n '.join(['Config:', ] + yaml.safe_dump(ctx.config, default_flow_style=False).splitlines())) log.info('Opening connections...') diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 544cc7f817a0..2830d934131f 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -520,14 +520,9 @@ def task(ctx, config): ) if ctx.archive is not None: - os.mkdir(ctx.archive) - with file(os.path.join(ctx.archive, 'ceph-sha1'), 'w') as f: f.write(sha1 + '\n') - with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f: - yaml.safe_dump(ctx.config, f, default_flow_style=False) - log.info('Compressing logs...') run.wait( ctx.cluster.run(