Use parent project from project config

Do not rely on naming scheme used in the script to setup staging projects.
This commit is contained in:
Michal Hrusecky 2013-12-11 20:14:50 +01:00
parent deecc15713
commit 52e9dd1b89

View File

@ -59,9 +59,12 @@ def _staging_check(self, project, check_everything, opts):
# Get staging project results
f = show_prj_results_meta(apiurl, project)
root = ET.fromstring(''.join(f))
# Get parent project results
f = show_prj_results_meta(apiurl, re.sub(r":Staging:[^:]*$", "", project))
p_root = ET.fromstring(''.join(f))
# Get parent project
m_url = make_meta_url("prj", project, apiurl)
m_data = http_GET(m_url).readlines()
m_root = ET.fromstring(''.join(m_data))
print "Comparing build statuses"
# Iterate through all repos/archs
@ -70,7 +73,17 @@ def _staging_check(self, project, check_everything, opts):
if results.get("state") not in [ "published", "unpublished" ]:
print >>sys.stderr, "Warning: Building not finished yet for %s/%s (%s)!"%(results.get("repository"),results.get("arch"),results.get("state"))
ret |= 2
# Find coresponding set of results in parent project
# Get parent project results
p_project = m_root.find("repository[@name='%s']/path"%(results.get("repository")))
if p_project == None:
print >>sys.stderr, "Error: Can't get path for '%s'!"%results.get("repository")
ret |= 4
next
f = show_prj_results_meta(apiurl, p_project.get("project"))
p_root = ET.fromstring(''.join(f))
# Find corresponding set of results in parent project
p_results = p_root.find("result[@repository='%s'][@arch='%s']"%(results.get("repository"),results.get("arch")))
if p_results == None:
print >>sys.stderr, "Error: Inconsistent setup!"