From dcbdb283179e600cdc78f374a206df90c765f664 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Thu, 20 Feb 2020 11:59:53 +0100 Subject: [PATCH] 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 --- qa/tasks/cephadm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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', -- 2.39.5