From: Patrick Donnelly Date: Wed, 27 May 2026 15:38:13 +0000 (-0400) Subject: teuthology/repo_utils: strip only .git suffix X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4383c30b53c7c579eb561ff8dbd8285eecb898d7;p=teuthology.git teuthology/repo_utils: strip only .git suffix Previous code with strip any trailing letters in .git. Signed-off-by: Patrick Donnelly --- diff --git a/teuthology/repo_utils.py b/teuthology/repo_utils.py index bb959b5c2..ced53ba48 100644 --- a/teuthology/repo_utils.py +++ b/teuthology/repo_utils.py @@ -405,9 +405,10 @@ def url_to_dirname(url): 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).group(1) # Strip '.git' from the right-hand side - string = string.rstrip('.git') + if string.endswith('.git'): + string = string[:-4] # Replace certain characters with underscores string = re.sub('[:/]', '_', string) # Remove duplicate underscores