From: Nathan Cutler Date: Sat, 8 Jul 2017 08:48:49 +0000 (+0200) Subject: qa: workunit: handle repo ending in "/ceph-ci" X-Git-Tag: v12.1.1~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16228%2Fhead;p=ceph.git qa: workunit: handle repo ending in "/ceph-ci" If the repo ends in "/ceph-ci" it's the same as if it ended in "/ceph-ci.git" Before this change, the following command was broken if the workunit specified, e.g., "branch: jewel": teuthology-suite --ceph-repo https://github.com/ceph/ceph --ceph master --suite-repo https://github.com/ceph/ceph-ci --suite-branch wip-foo . . . Fixes: http://tracker.ceph.com/issues/20554 Signed-off-by: Nathan Cutler --- diff --git a/qa/tasks/workunit.py b/qa/tasks/workunit.py index 888b75eefff5..ffd8b2202844 100644 --- a/qa/tasks/workunit.py +++ b/qa/tasks/workunit.py @@ -4,6 +4,7 @@ Workunit task -- Run ceph on sets of specific clients import logging import pipes import os +import re from copy import deepcopy from util import get_remote_for_role @@ -377,9 +378,12 @@ def _run_tests(ctx, refspec, role, tests, env, subdir=None, timeout=None): remote.run(logger=log.getChild(role), args=refspec.clone(git_url, clonedir)) except CommandFailedError: - if not git_url.endswith('/ceph-ci.git'): + if git_url.endswith('/ceph-ci.git'): + alt_git_url = git_url.replace('/ceph-ci.git', '/ceph.git') + elif git_url.endswith('/ceph-ci'): + alt_git_url = re.sub(r'/ceph-ci$', '/ceph.git', git_url) + else: raise - alt_git_url = git_url.replace('/ceph-ci.git', '/ceph.git') log.info( "failed to check out '%s' from %s; will also try in %s", refspec,