From e8b156bb2ead5a96a931e0443ce77d3aea47b742 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sun, 12 Aug 2007 19:38:29 +0000 Subject: seppuku: misc fixes * better error messages * fixed bug creation and attachment handling * now reports machine in bug content (till we have a machine section in bugzilla) --- classes/seppuku.bbclass | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'classes/seppuku.bbclass') diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index 9e9772cb67..7ae1458b89 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -218,9 +218,9 @@ def seppuku_file_bug(poster, file, product, component, bugname, text): # scan the result for a bug number # it will look like - # 'Back To BUG# 308' + # 'Bug 2742 Submitted' import re - res = re.findall(("\>Back To BUG\# (?P\d+)\"), result.read() ) + res = re.findall(("\>Bug (?P\d+) Submitted"), result.read() ) if result.code != 200 or len(res) != 1: return None else: @@ -234,7 +234,7 @@ def seppuku_create_attachment(debug, poster, attach_query, product, component, b if not bug_number: import bb - bb.note("Can't create an attachment, the bug is not present") + bb.note("Can't create an attachment, no bugnumber passed to method") return False import urllib2 @@ -320,15 +320,15 @@ python seppuku_eventhandler() { "pr" : bb.data.getVar("PR", data, True), "task" : e.task } log_file = glob.glob("%s/log.%s.*" % (bb.data.getVar('T', event.data, True), event.task)) - text = "The package failed to build at %s" % bb.data.getVar('DATETIME', data, True) + text = "The package failed to build at %s for machine %s" % (bb.data.getVar('DATETIME', data, True), bb.data.getVar( 'MACHINE', data, True ) ) if len(log_file) != 0: print >> debug_file, "Adding log file %s" % log_file[0] file = open(log_file[0], 'r') else: print >> debug_file, "No log file found for the glob" - elif name == "NoProvider": - bugname = "noprovider for %s " % (event.getItem) - text = "Please fix it" + #elif name == "NoProvider": + # bugname = "noprovider for %s " % (event.getItem) + # text = "Please fix it" else: print >> debug_file, "Unknown name '%s'" % name assert False @@ -349,11 +349,11 @@ python seppuku_eventhandler() { else: bug_number = seppuku_file_bug(poster, newbug, product, component, bugname, text) if not bug_number: - print >> debug_file, "Filing a bugreport failed" + print >> debug_file, "Couldn't acquire a new bug_numer, filing a bugreport failed" else: print >> debug_file, "The new bug_number: '%s'" % bug_number - if file: + if bug_number and file: if not seppuku_create_attachment(debug_file, poster, attach, product, component, bug_number, text, file): print >> debug_file, "Failed to attach the build log" else: -- cgit 1.2.3-korg