]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Check for broken repos before updating
authorZack Cerza <zack@cerza.org>
Thu, 29 May 2014 18:23:23 +0000 (13:23 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 29 May 2014 18:23:23 +0000 (13:23 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/worker.py

index 220706749234b24d823e724effa47be6c15caa7c..7c80d957743a22b1d972b68f93317b5406f21cdc 100644 (file)
@@ -91,6 +91,11 @@ def fetch_teuthology_branch(path, branch='master'):
     lock = filelock('%s.lock' % path)
     lock.acquire()
     try:
+        if os.path.isdir(path) and \
+                not os.path.isdir(os.path.join(path, '.git')):
+            log.info("Removing possibly-corrupt repo for branch %s", branch)
+            shutil.rmtree(path)
+
         if not os.path.isdir(path):
             log.info("Cloning %s from upstream", branch)
             teuthology_git_upstream = teuth_config.ceph_git_base_url + \