raise
return
+
+ def get_build_results(self, prj, view=None, code=None,):
+ """ get build results """
+
+ query = []
+ if view:
+ query.append('view=%s' %(view))
+ else:
+ query.append('view=summary')
+
+ if code:
+ query.append('code=%s' %(code))
+
+ u = core.makeurl(self.apiurl, ['build', prj, '_result'],query=query)
+ try:
+ f = core.http_GET(u)
+ return ''.join(f.readlines())
+ except urllib2.HTTPError, err:
+ print err
+ return err
+
+ def getbuildstatus(self, project):
+ """ get build status """
+ resultdata = {}
+ summarylist = []
+ results_summary = self.get_build_results(project)
+ et = ElementTree.fromstring(''.join(results_summary))
+ for result in et.findall('result'):
+ for summary in result.findall('summary'):
+ for status in summary.findall('statuscount'):
+ if status.get('code') in ("succeeded","unresolvable","failed"):
+ summarylist.append({'repo':result.get('repository'), \
+ 'arch':result.get('arch'), \
+ 'code':status.get('code'), \
+ 'count':status.get('count')
+ })
+ resultdata['buildstatus'] = summarylist
+ return resultdata
+
def addPerson(self, prj, users):
"""
add persons to a project
if action == 'create_images':
repo = content.get("repo")
+ info = build.get_info(project)
+ buildstatus = build.getbuildstatus(project)
+ print 'buildstatus=%s' %(buildstatus)
+ build.update_buildstatus(buildstatus,project)
# cleanup src.rpm files on Live repo
# we don't used src.rpm files on prerelease project.