Merge pull request #119 from openSUSE/coolo_parse_jobs

openqa changed the sort order in list_jobs
This commit is contained in:
Alberto Planas 2014-03-21 09:48:01 +01:00
commit e1a400958d

View File

@ -600,11 +600,12 @@ class StagingAPI(object):
jobname += '.{}'.format(bn)
jobname += "-minimalx"
job_id = None
bestjob = None
for job in jobs:
if job['name'] == jobname and job['result'] != 'incomplete':
job_id = job['id']
return job_id
if not bestjob or bestjob['result'] != 'passed':
bestjob = job
return bestjob['id'] if bestjob else None
def find_openqa_state(self, project):
"""