]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
repo_utils: improve the handling about another git ssh expression
authorVicente Cheng <freeze.bilsted@gmail.com>
Wed, 6 Jun 2018 10:13:00 +0000 (18:13 +0800)
committerVicente Cheng <freeze.bilsted@gmail.com>
Wed, 1 Apr 2020 04:10:41 +0000 (04:10 +0000)
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
teuthology/repo_utils.py

index a9c391fee85a19e1363aefa3cbe0f544e43ae64f..e9aaf636d795f029ca44aa7b8cd183b5a27884fb 100644 (file)
@@ -352,13 +352,14 @@ def url_to_dirname(url):
     Given a URL, returns a string that's safe to use as a directory name.
     Examples:
 
+        git@git.ceph.com/ceph-qa-suite.git -> git.ceph.com_ceph-qa-suite
         git://git.ceph.com/ceph-qa-suite.git -> git.ceph.com_ceph-qa-suite
         https://github.com/ceph/ceph -> github.com_ceph_ceph
         https://github.com/liewegas/ceph.git -> github.com_liewegas_ceph
         file:///my/dir/has/ceph.git -> my_dir_has_ceph
     """
     # Strip protocol from left-hand side
-    string = re.match('.*://(.*)', url).groups()[0]
+    string = re.match('(?:.*://|.*@)(.*)', url).groups()[0]
     # Strip '.git' from the right-hand side
     string = string.rstrip('.git')
     # Replace certain characters with underscores