[kteam-tools PATCH] start-sru-cycle: Handle failing bug creation more gracefully

Stefan Bader stefan.bader at canonical.com
Wed Apr 26 14:21:55 UTC 2017


A quick fix which maybe could be more elegant and the actual error message
is up for bike shedding.

-Stefan

>From f56479f1f5c47501d5b311724125d1192e798bfa Mon Sep 17 00:00:00 2001
From: Stefan Bader <stefan.bader at canonical.com>
Date: Wed, 26 Apr 2017 16:15:23 +0200
Subject: [PATCH] start-sru-cycle: Handle failing bug creation more gracefully

Calling tb.open() can return None when it completely fails to create
the new bug report. One major reason for this seems to be that the
package does not exist on the ubuntu project.
Instead of failing completely, print an error message and go on with
the other backports or derivatives.
Still fail completely if the master bug cannot be created because that
really is ultimately bad.

Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
---
 stable/start-sru-cycle | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/stable/start-sru-cycle b/stable/start-sru-cycle
index daab835..6e7528c 100755
--- a/stable/start-sru-cycle
+++ b/stable/start-sru-cycle
@@ -105,6 +105,9 @@ class Crankers():
                     for backport_project, backport_series in data[series][master_project]['backports']:
                         print('        %s:%s' % (backport_series, backport_project))
                         bug = tb.open(backport_project, '<version to be filled>', True, master_bug.id, backport_series)
+                        if bug == None:
+                            print('     -> EE: Bug creation failed (does the package exist in the archive?)!')
+                            continue
                         bug.tags.append(cycle_tag)
                         backports.append(str(bug.id))
                         bug.tags.append('kernel-sru-backport-of-%s' % master_bug.id)
@@ -113,6 +116,9 @@ class Crankers():
                     for derivative_project in data[series][master_project]['derivatives']:
                         print('        ' + derivative_project)
                         bug = tb.open(derivative_project, '<version to be filled>', True, master_bug.id, series)
+                        if bug == None:
+                            print('     -> EE: Bug creation failed (does the package exist in the archive?)!')
+                            continue
                         bug.tags.append(cycle_tag)
                         derivatives.append(str(bug.id))
                         bug.tags.append('kernel-sru-derivative-of-%s' % master_bug.id)
-- 
2.7.4





More information about the kernel-team mailing list