From: Nathan Cutler Date: Thu, 20 Feb 2020 10:59:53 +0000 (+0100) Subject: qa/tasks/cephadm.py: lop off .git more robustly X-Git-Tag: v15.1.1~348^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dcbdb283179e600cdc78f374a206df90c765f664;p=ceph-ci.git qa/tasks/cephadm.py: lop off .git more robustly The line rest.replace('.git/', '/') was added to accommodate weird folks who run teuthology-suite with an option like this: --suite-repo https://github.com/ceph/ceph.git/ but they might just as well give the option like this: --suite-repo https://github.com/ceph/ceph.git Signed-off-by: Nathan Cutler --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 3a48bdebf93..1dd66675264 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -9,6 +9,7 @@ import contextlib import logging import os import json +import re import uuid from ceph_manager import CephManager @@ -92,7 +93,7 @@ def download_cephadm(ctx, config, ref): if git_url.startswith('https://github.com/'): # git archive doesn't like https:// URLs, which we use with github. rest = git_url.split('https://github.com/', 1)[1] - rest.replace('.git/', '/') # no .git suffix + rest = re.sub(r'\.git/?$', '', rest).strip() # no .git suffix ctx.cluster.run( args=[ 'curl', '--silent',