]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/workunit: retry on ceph.git if checkout fails 12538/head
authorSage Weil <sage@redhat.com>
Fri, 16 Dec 2016 20:06:16 +0000 (15:06 -0500)
committerSage Weil <sage@redhat.com>
Fri, 16 Dec 2016 20:06:16 +0000 (15:06 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/workunit.py

index 5bc9cf1fd01c4f0575bb14d5e5608024427abbba..8320b2438786089f0cea796c8c9b869026a00f76 100644 (file)
@@ -309,19 +309,41 @@ def _run_tests(ctx, refspec, role, tests, env, subdir=None, timeout=None):
     srcdir = '{cdir}/qa/workunits'.format(cdir=clonedir)
 
     git_url = teuth_config.get_ceph_git_url()
-    remote.run(
-        logger=log.getChild(role),
-        args=[
-            'git',
-            'clone',
+    try:
+        remote.run(
+            logger=log.getChild(role),
+            args=[
+                'git',
+                'clone',
+                git_url,
+                clonedir,
+                run.Raw(';'),
+                'cd', '--', clonedir,
+                run.Raw('&&'),
+                'git', 'checkout', refspec,
+            ],
+        )
+    except CommandFailedError:
+        alt_git_url = git_url.replace('ceph-ci', 'ceph')
+        log.info(
+            "failed to check out '%s' from %s; will also try in %s",
+            refspec,
             git_url,
-            clonedir,
-            run.Raw(';'),
-            'cd', '--', clonedir,
-            run.Raw('&&'),
-            'git', 'checkout', refspec,
-        ],
-    )
+            alt_git_url,
+        )
+        remote.run(
+            logger=log.getChild(role),
+            args=[
+                'git',
+                'clone',
+                alt_git_url,
+                clonedir,
+                run.Raw(';'),
+                'cd', '--', clonedir,
+                run.Raw('&&'),
+                'git', 'checkout', refspec,
+            ],
+        )
 
     remote.run(
         logger=log.getChild(role),