From 5c055b26e7e159559f66079fb17e27839dcd1af5 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 21 Sep 2016 17:43:39 -0600 Subject: [PATCH] ShamanProject: correct ref precedence Signed-off-by: Zack Cerza --- teuthology/packaging.py | 9 +++++---- teuthology/test/test_packaging.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/teuthology/packaging.py b/teuthology/packaging.py index cc02a3a540..860e9764e8 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -792,10 +792,11 @@ class ShamanProject(GitbuilderProject): req_obj['project'] = self.project req_obj['flavor'] = flavor req_obj['distros'] = '%s/%s' % (self.distro, self.arch) - if getattr(self, 'branch', None): - req_obj['ref'] = self.branch - if self.sha1: - req_obj['sha1'] = self.sha1 + ref_name, ref_val = self._choose_reference().items()[0] + if ref_name == 'sha1': + req_obj['sha1'] = ref_val + else: + req_obj['ref'] = ref_val req_str = urllib.urlencode(req_obj) uri = urlparse.urljoin( self.query_url, diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index 2d1ff8451e..fc56caca88 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -639,7 +639,7 @@ class TestShamanProject(TestBuilderProject): .test_init_from_remote_base_url( "https://shaman.ceph.com/api/search?status=ready" "&project=ceph&flavor=default" - "&distros=ubuntu%2F14.04%2Fx86_64" + "&distros=ubuntu%2F14.04%2Fx86_64&ref=master" ) def test_init_from_remote_base_url_debian(self): @@ -657,7 +657,7 @@ class TestShamanProject(TestBuilderProject): .test_init_from_remote_base_url_debian( "https://shaman.ceph.com/api/search?status=ready" "&project=ceph&flavor=default" - "&distros=debian%2F7.1%2Fx86_64" + "&distros=debian%2F7.1%2Fx86_64&ref=master" ) def test_init_from_config_base_url(self): -- 2.39.5