1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

prepare for the serviceinfo element having an xsrcmd5 in the error case

This commit is contained in:
Michael Schroeder 2013-10-18 14:58:18 +02:00
parent 5ef2d4035c
commit 930974b4ab

View File

@ -3389,8 +3389,9 @@ def show_upstream_srcmd5(apiurl, prj, pac, expand=False, revision=None, meta=Fal
et = ET.fromstring(''.join(m))
if include_service_files:
try:
if et.find('serviceinfo') and et.find('serviceinfo').get('xsrcmd5'):
return et.find('serviceinfo').get('xsrcmd5')
sinfo = et.find('serviceinfo')
if sinfo and sinfo.get('xsrcmd5') and not sinfo.get('error'):
return sinfo.get('xsrcmd5')
except:
pass
return et.get('srcmd5')
@ -3425,7 +3426,9 @@ def show_upstream_rev(apiurl, prj, pac, revision=None, expand=False, linkrev=Non
et = ET.fromstring(''.join(m))
if include_service_files:
try:
return et.find('serviceinfo').get('xsrcmd5')
sinfo = et.find('serviceinfo')
if sinfo and sinfo.get('xsrcmd5') and not sinfo.get('error'):
return sinfo.get('xsrcmd5')
except:
pass
return et.get('rev')