1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 13:18:42 +02:00

Merge pull request #552 from lethliel/fix_unhandled_exception_on_empty_package

fix triggerreason on empty packages.
This commit is contained in:
Marco Strigl
2019-06-12 13:07:16 +02:00
committed by GitHub

View File

@@ -5654,9 +5654,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print(apiurl, project, package, repository, arch)
xml = show_package_trigger_reason(apiurl, project, package, repository, arch)
root = ET.fromstring(xml)
reason = root.find('explain').text
triggertime = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(root.find('time').text)))
print("%s (at %s)" % (reason, triggertime))
if root.find('explain') is None:
reason = "No triggerreason found"
print(reason)
else:
reason = root.find('explain').text
triggertime = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(root.find('time').text)))
print("%s (at %s)" % (reason, triggertime))
if reason == "meta change":
print("changed keys:")
for package in root.findall('packagechange'):