From ae77af084743fd517262c9cce338c14ad27ab121 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 9 Jun 2011 16:39:20 -0700 Subject: [PATCH] Simplify ceph sha1 saving. No need to round-trip, store N copies. --- teuthology/task/ceph.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 36d20b0488bfe..d503723ab4c4c 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -152,21 +152,6 @@ def task(ctx, config): teuthology.feed_many_stdins_and_close(conf_fp, writes) run.wait(writes) - version_fp = StringIO() - version_fp.write(sha1 + '\n') - version_fp.seek(0) - writes = ctx.cluster.run( - args=[ - 'python', - '-c', - 'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))', - '/tmp/cephtest/coverage/ceph_version', - ], - stdin=run.PIPE, - wait=False, - ) - teuthology.feed_many_stdins_and_close(version_fp, writes) - log.info('Setting up mon.0...') ctx.cluster.only('mon.0').run( args=[ @@ -537,6 +522,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') + log.info('Compressing logs...') run.wait( ctx.cluster.run( -- 2.39.5