]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add retries to fetch_qa_suite()
authorZack Cerza <zack.cerza@inktank.com>
Tue, 12 Aug 2014 16:39:23 +0000 (10:39 -0600)
committerZack Cerza <zack.cerza@inktank.com>
Tue, 12 Aug 2014 16:41:23 +0000 (10:41 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/repo_utils.py

index 339b4f42cd39180b12857dfede47463f49f400d5..284a350f74d4297d130ebd0fe7e0040af76cddf9 100644 (file)
@@ -6,6 +6,7 @@ import subprocess
 import time
 
 from .config import config
+from .contextutil import safe_while
 from .exceptions import BranchNotFoundError, GitError
 
 log = logging.getLogger(__name__)
@@ -164,7 +165,13 @@ def fetch_qa_suite(branch, lock=True):
     # only let one worker create/update the checkout at a time
     lock_path = dest_path.rstrip('/') + '.lock'
     with FileLock(lock_path, noop=not lock):
-        enforce_repo_state(qa_suite_url, dest_path, branch)
+        with safe_while() as proceed:
+            while proceed():
+                try:
+                    enforce_repo_state(qa_suite_url, dest_path, branch)
+                    break
+                except GitError:
+                    log.exception()
     return dest_path