]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Move suite.util.build_git_url to repo_utils
authorZack Cerza <zack@redhat.com>
Wed, 19 Oct 2016 21:01:12 +0000 (15:01 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 19 Oct 2016 21:01:12 +0000 (15:01 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/repo_utils.py
teuthology/suite/util.py

index a815f355497da9956e353ded9564aacdf075357f..93ac41bf22c693afaf8308067f200f24ad3aea93 100644 (file)
@@ -1,6 +1,7 @@
 import fcntl
 import logging
 import os
+import re
 import shutil
 import subprocess
 import time
@@ -36,6 +37,20 @@ def is_fresh(path):
     return False
 
 
+def build_git_url(project, project_owner='ceph'):
+    """
+    Return the git URL to clone the project
+    """
+    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)
+    return url_templ.format(project_owner=project_owner, project=project)
+
+
 def ls_remote(url, ref):
     """
     Return the current sha1 for a given repository and ref
index 7dd78c010b701c3e3fe297fc498ee9203df6ed9d..8d372769f1965ac9fa846bfbba68f8c5eed15adc 100644 (file)
@@ -1,7 +1,6 @@
 import copy
 import logging
 import os
-import re
 import requests
 import smtplib
 import socket
@@ -19,6 +18,7 @@ from ..misc import deep_merge
 from ..repo_utils import fetch_qa_suite, fetch_teuthology
 from ..orchestra.opsys import OS
 from ..packaging import get_builder_project
+from ..repo_utils import build_git_url
 from ..task.install import get_flavor
 
 log = logging.getLogger(__name__)
@@ -205,20 +205,6 @@ def git_validate_sha1(project, sha1, project_owner='ceph'):
     return None
 
 
-def build_git_url(project, project_owner='ceph'):
-    """
-    Return the git URL to clone the project
-    """
-    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)
-    return url_templ.format(project_owner=project_owner, project=project)
-
-
 def git_branch_exists(project, branch, project_owner='ceph'):
     """
     Query the git repository to check the existence of a project's branch