]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm.py: lop off .git more robustly
authorNathan Cutler <ncutler@suse.com>
Thu, 20 Feb 2020 10:59:53 +0000 (11:59 +0100)
committerNathan Cutler <ncutler@suse.com>
Thu, 20 Feb 2020 16:22:17 +0000 (17:22 +0100)
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 <ncutler@suse.com>
qa/tasks/cephadm.py

index 3a48bdebf932a1c79469fac41673bc4c292e2bdb..1dd6667526447ccc9c87ddac18cb8bc53f2640a2 100644 (file)
@@ -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',