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,
.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):
.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):