Merge pull request #33 from aplanas/master

Fix bug from this morning
This commit is contained in:
Stephan Kulow 2013-09-27 08:38:25 -07:00
commit 0d04d88272

View File

@ -320,12 +320,12 @@ def memoize(ttl=None):
@memoize() @memoize()
def build(apiurl, project, repo, arch, package): def build(apiurl, project, repo, arch, package):
root = None
try: try:
url = makeurl(apiurl, ['build', project, repo, arch, package]) url = makeurl(apiurl, ['build', project, repo, arch, package])
root = http_GET(url).read() root = http_GET(url).read()
except urllib2.HTTPError, e: except urllib2.HTTPError, e:
print 'ERROR in URL %s [%s]'%(url, e) print 'ERROR in URL %s [%s]'%(url, e)
return False
return root return root
@ -416,10 +416,12 @@ def _check_repo_fetch_group(self, opts, group):
def _check_repo_avoid_wrong_friends(self, prj, repo, arch, pkg, opts): def _check_repo_avoid_wrong_friends(self, prj, repo, arch, pkg, opts):
root = ET.fromstring(build(opts.apiurl, prj, repo, arch, pkg)) xml = build(opts.apiurl, prj, repo, arch, pkg)
for binary in root.findall('binary'): if xml:
# if there are binaries, we're out root = ET.fromstring(xml)
return False for binary in root.findall('binary'):
# if there are binaries, we're out
return False
return True return True
@ -627,7 +629,7 @@ def _check_repo_buildsuccess(self, p, opts):
print 'DECLINED', msg print 'DECLINED', msg
self._check_repo_change_review_state(opts, p.request, 'declined', message=msg) self._check_repo_change_review_state(opts, p.request, 'declined', message=msg)
return False return False
if foundbuilding: if foundbuilding:
msg = "{1} is still building for repository {0}".format(foundbuilding, p.spackage) msg = "{1} is still building for repository {0}".format(foundbuilding, p.spackage)
self._check_repo_change_review_state(opts, p.request, 'new', message=msg) self._check_repo_change_review_state(opts, p.request, 'new', message=msg)
print 'UPDATED', msg print 'UPDATED', msg