]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Use check_output() and log.exception() 88/head
authorZack Cerza <zack@cerza.org>
Thu, 12 Sep 2013 16:14:08 +0000 (11:14 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 12 Sep 2013 16:14:08 +0000 (11:14 -0500)
This should help us figure out why our checkouts keep getting deleted.

teuthology/queue.py

index cf277a9233c4036ee8e208b62c4d1692cdbc52e3..35afaadb77f3cb743d0471f619526829b8f92535 100644 (file)
@@ -62,20 +62,22 @@ def fetch_teuthology_branch(path, branch='master'):
             log.info(
                 subprocess.check_output(('git', 'fetch', '-p', 'origin'),
                                         cwd=path)
-                )
+            )
             log.info(
                 subprocess.check_output(('touch', path))
-                )
+            )
         else:
             log.info("%s was just updated; assuming it is current", branch)
 
         # This try/except block will notice if the requested branch doesn't
         # exist, whether it was cloned or fetched.
         try:
-            subprocess.check_call(('git', 'reset', '--hard', 'origin/%s' % branch),
-                                  cwd=path)
+            subprocess.check_output(
+                ('git', 'reset', '--hard', 'origin/%s' % branch),
+                cwd=path,
+            )
         except subprocess.CalledProcessError:
-            log.error("teuthology branch not found: %s", branch)
+            log.exception("teuthology branch not found: %s", branch)
             shutil.rmtree(path)
             raise
 
@@ -87,7 +89,7 @@ def fetch_teuthology_branch(path, branch='master'):
         env['NO_CLOBBER'] = '1'
         log.info(
             subprocess.check_output(('./bootstrap'), cwd=path, env=env)
-            )
+        )
 
     finally:
         lock.release()