]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Minimize scope of try-except.
authorTommi Virtanen <tv@inktank.com>
Wed, 8 Aug 2012 21:45:49 +0000 (14:45 -0700)
committerTommi Virtanen <tv@inktank.com>
Wed, 8 Aug 2012 21:45:49 +0000 (14:45 -0700)
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

index b029075ea7d35aa2d1a1e069de737ba4a90a9452..b6b178e1b932aef9b2982e96bb859701269e2b53 100644 (file)
@@ -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,