From 98eda9a4dc56d5dd2af38d8e97b2cbeba43b6e87 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Sat, 8 Jul 2017 10:48:49 +0200 Subject: [PATCH] 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 --- qa/tasks/workunit.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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, -- 2.47.3