diff mbox series

[kteam-tools] stable/create-stable-tracker: do not fail if obsolete Ubuntu series

Message ID 20200413162936.2431-1-kamal@canonical.com
State New
Headers show
Series [kteam-tools] stable/create-stable-tracker: do not fail if obsolete Ubuntu series | expand

Commit Message

Kamal Mostafa April 13, 2020, 4:29 p.m. UTC
Sometimes, we need to continue creating tracking bugs even after
Launchpad stops supporting an Ubuntu series.  Do not fail in this case;
Just create the tracking bug without any series nomination.

More specifically, if the nomination step fails for any reason after the
bug has already been created (e.g. Launchpad timeout), do print the link
to the created bug.

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 stable/create-stable-tracker | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/stable/create-stable-tracker b/stable/create-stable-tracker
index c088b01f..6a300a59 100755
--- a/stable/create-stable-tracker
+++ b/stable/create-stable-tracker
@@ -221,9 +221,13 @@  class CreateTrackingBug(StdApp):
             sc = ubuntu.series_collection
             for s in sc:
                 if s.name == series_name:
-                    nomination = bug.lpbug.addNomination(target=s)
-                    if nomination.canApprove():
-                        nomination.approve()
+                    try:
+                        nomination = bug.lpbug.addNomination(target=s)
+                        if nomination.canApprove():
+                            nomination.approve()
+                    except:
+                        print("WARNING: Bug created, but series nomination failed!")
+                        pass
 
             if 'staging' in self.cfg:
                 print("https://bugs.%s.launchpad.net/bugs/%s" % (self.defaults['launchpad_services_root'], bug.id))