]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: use get_ceph_*_url when checking branches 678/head
authorLoic Dachary <ldachary@redhat.com>
Tue, 20 Oct 2015 00:03:10 +0000 (02:03 +0200)
committerLoic Dachary <ldachary@redhat.com>
Wed, 28 Oct 2015 05:41:00 +0000 (14:41 +0900)
Otherwise the check is always done on the default
http://github.com/ceph/xxx

Signed-off-by: Loic Dachary <ldachary@redhat.com>
teuthology/suite.py

index df0ba60f8cec45dd06febb6491f89a8f34479f69..8c2b82cf15dc8f50626950a37c5e1ecef9f1e180 100644 (file)
@@ -8,6 +8,7 @@ import logging
 import os
 import requests
 import pwd
+import re
 import subprocess
 import smtplib
 import socket
@@ -468,7 +469,13 @@ def github_branch_exists(project, branch, project_owner='ceph'):
     """
     Query GitHub to check the existence of a project's branch
     """
-    url_templ = 'https://github.com/{project_owner}/{project}/tree/{branch}'
+    if project == 'ceph-qa-suite':
+        base = config.get_ceph_qa_suite_git_url()
+    elif project == 'ceph':
+        base = config.get_ceph_git_url()
+    else:
+        base = 'https://github.com/{project_owner}/{project}'
+    url_templ = re.sub('\.git$', '', base) + '/tree/{branch}'
     url = url_templ.format(project_owner=project_owner, project=project,
                            branch=branch)
     resp = requests.head(url)