[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fedora-buildsys-list
Subject:    [PATCH] koji - print reason of failed task in output of taskinfo
From:       Dan =?ISO-8859-1?Q?Hor=E1k?= <dan () danny ! cz>
Date:       2010-05-28 15:54:59
Message-ID: 1275062099.2805.91.camel () eagle ! danny ! cz
[Download RAW message or body]

During the running the mass-rebuild for Fedora/s390x I have found that
it would be useful if koji-cli could return also the reason for failed
task. Same information can be seen in taskinfo web interface. Usually
build failure with details in root.log means some missing/broken
dependency in buildroot, details in build.log mean a real failure where
a manual inspection is needed, etc.

The result is in the attached patch.


Dan


["0001-print-reason-of-failed-task-in-taskinfo.patch" (0001-print-reason-of-failed-task-in-taskinfo.patch)]

>From 9abcbc2a05caaa1b891297b61cad91dc8508b876 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan Horák?= <dan@danny.cz>
Date: Fri, 28 May 2010 17:44:57 +0200
Subject: [PATCH] print reason of failed task in taskinfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It is useful to output also the reason of failed task in the output of
taskinfo as it allows further action depending on the cause.

Signed-off-by: Dan Horák <dan@danny.cz>
---
 cli/koji |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/cli/koji b/cli/koji
index 3c1c109..8d0754c 100755
--- a/cli/koji
+++ b/cli/koji
@@ -3261,6 +3261,21 @@ def _printTaskInfo(session, task_id, level=0, recurse=True, verbose=True):
         for filename in output:
             print "%s %s/%s" % (indent, files_dir, filename)

+    if verbose and info['state'] == koji.TASK_STATES['FAILED']:
+        try:
+            result = session.getTaskResult(task_id)
+            excClass = None
+        except:
+            excClass, exc = sys.exc_info()[:2]
+            result = exc
+            excClass = excClass
+            # clear the exception, since we're just using
+            # it for display purposes
+            sys.exc_clear()
+
+	if excClass:
+	    print "%s: %s" % (excClass.__name__, result)
+
     # white space
     sys.stdout.write("\n")

--
1.6.6.1



--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic