From 05007f7e0ffcb6d20927213385e6b8bfdbf8f9f2 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Wed, 8 Aug 2012 14:45:49 -0700 Subject: [PATCH] Minimize scope of try-except. os.write and list.append won't raise CalledProcessError, and now we don't need to try to contain them for temp file clean up reasons. --- teuthology/queue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/queue.py b/teuthology/queue.py index b029075ea7..b6b178e1b9 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -121,9 +121,9 @@ def run_job(job_config, archive_path): prefix='teuthology-worker.', suffix='.tmp', ) as tmp: + os.write(tmp, yaml.safe_dump(job_config['config'])) + arg.append(tmp.name) try: - os.write(tmp, yaml.safe_dump(job_config['config'])) - arg.append(tmp.name) subprocess.check_call( args=arg, close_fds=True, -- 2.39.5