From 2779df0f51b11f1f43f875e8a1c02d83a8649570 Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Wed, 6 Jun 2018 18:13:00 +0800 Subject: [PATCH] repo_utils: improve the handling about another git ssh expression Signed-off-by: Vicente Cheng --- teuthology/repo_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teuthology/repo_utils.py b/teuthology/repo_utils.py index a9c391fee8..e9aaf636d7 100644 --- a/teuthology/repo_utils.py +++ b/teuthology/repo_utils.py @@ -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 -- 2.39.5