From f3757f76d87b761ebf3f82249c292e304492079b Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 9 Jun 2011 14:08:45 -0700 Subject: [PATCH] Let ceph task config specify branch or tag to run. --- teuthology/misc.py | 14 +++++++++++--- teuthology/task/ceph.py | 21 +++++++++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index c230aef894fbd..6d45fc3ec028b 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -9,10 +9,18 @@ import urlparse log = logging.getLogger(__name__) -def get_ceph_binary_url(): - BRANCH = 'master' #TODO +def get_ceph_binary_url(branch=None, tag=None): + # gitbuilder uses remote-style ref names for branches, mangled to + # have underscores instead of slashes; e.g. origin_master + if tag is not None: + ref = tag + assert branch is None, "cannot set both branch and tag" + else: + if branch is None: + branch = 'master' + ref = 'origin_{branch}'.format(branch=branch) BASE = 'http://ceph.newdream.net/gitbuilder/output/' - sha1_url = urlparse.urljoin(BASE, 'ref/origin_{branch}/sha1'.format(branch=BRANCH)) + sha1_url = urlparse.urljoin(BASE, 'ref/{ref}/sha1'.format(ref=ref)) sha1_fp = urllib2.urlopen(sha1_url) sha1 = sha1_fp.read().rstrip('\n') sha1_fp.close() diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index dbe113216fd78..296e5b34d016a 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -22,8 +22,22 @@ def task(ctx, config): tasks: - ceph: - interactive: + + You can also specify what branch to run:: + + tasks: + - ceph: + branch: foo + + Or a tag:: + + tasks: + - ceph: + tag: v0.42.13 + """ - assert config is None + if config is None: + config = {} log.info('Checking for old test directory...') processes = ctx.cluster.run( @@ -80,7 +94,10 @@ def task(ctx, config): ) log.info('Untarring ceph binaries...') - ceph_bindir_url = teuthology.get_ceph_binary_url() + ceph_bindir_url = teuthology.get_ceph_binary_url( + branch=config.get('branch'), + tag=config.get('tag'), + ) ctx.cluster.run( args=[ 'uname', '-m', -- 2.39.5