import os
from teuthology import misc
+from teuthology.config import config as teuth_config
from teuthology.orchestra.run import CommandFailedError
from teuthology.parallel import parallel
from teuthology.orchestra import run
else:
scratch_tmp = os.path.join(mnt, subdir)
srcdir = '{tdir}/workunit.{role}'.format(tdir=testdir, role=role)
+ clonedir = '{tdir}/clone'.format(tdir=testdir)
+
+ git_url = teuth_config.get_ceph_git_url()
+ if 'github.com/ceph/ceph' in git_url:
+ remote.run(
+ logger=log.getChild(role),
+ args=[
+ 'mkdir', '--', srcdir,
+ run.Raw('&&'),
+ 'git',
+ 'archive',
+ '--remote=git://git.ceph.com/ceph.git',
+ '%s:qa/workunits' % refspec,
+ run.Raw('|'),
+ 'tar',
+ '-C', srcdir,
+ '-x',
+ '-f-',
+ ],
+ )
+ else:
+ remote.run(
+ logger=log.getChild(role),
+ args=[
+ 'git',
+ 'clone',
+ git_url,
+ clonedir,
+ run.Raw(';'),
+ 'cd', '--', clonedir,
+ run.Raw('&&'),
+ 'git', 'reset', '--hard', refspec,
+ run.Raw('&&'),
+ 'mv', 'qa/workunits', srcdir,
+ ],
+ )
remote.run(
logger=log.getChild(role),
args=[
- 'mkdir', '--', srcdir,
- run.Raw('&&'),
- 'git',
- 'archive',
- '--remote=git://git.ceph.com/ceph.git',
- '%s:qa/workunits' % refspec,
- run.Raw('|'),
- 'tar',
- '-C', srcdir,
- '-x',
- '-f-',
- run.Raw('&&'),
'cd', '--', srcdir,
run.Raw('&&'),
'if', 'test', '-e', 'Makefile', run.Raw(';'), 'then', 'make', run.Raw(';'), 'fi',
remote.run(
logger=log.getChild(role),
args=[
- 'rm', '-rf', '--', workunits_file, srcdir,
+ 'rm', '-rf', '--', workunits_file, srcdir, clonedir,
],
)