Gather initial buildid of repositories

This commit is contained in:
Stephan Kulow 2018-10-08 10:37:28 +02:00
parent d1c3e212d7
commit dab6850133

12
rabbit-openqa.py Normal file → Executable file
View File

@ -38,10 +38,16 @@ class Project(object):
ret.append(self.map_iso(name, entry.get('name')))
return ret
def gather_buildid(self, name, repository):
url = self.api.makeurl(['published', name, repository], {'view': 'status'})
f = self.api.retried_GET(url)
id = ET.parse(f).getroot().find('buildid')
if id is not None:
return id.text
def initial_staging_state(self, name):
ret = {'isos': self.gather_isos(name, 'images')}
# missing API for initial repo id
return ret
return {'isos': self.gather_isos(name, 'images'),
'id': self.gather_buildid(name, 'images')}
def update_staging_buildid(self, project, repository, buildid):
self.staging_projects[project]['id'] = buildid