[PATCH] swm: promote_to_updates.py: check for snap tasks before closing tb

Kleber Sacilotto de Souza kleber.souza at canonical.com
Mon Dec 18 11:34:14 UTC 2017


Do not close the tracking bug until all the snap-related tasks are
either Invalid or Fix Released.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza at canonical.com>
---
 stable/wfl/wft/promote_to_updates.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
index d0377cf4..29f6c393 100644
--- a/stable/wfl/wft/promote_to_updates.py
+++ b/stable/wfl/wft/promote_to_updates.py
@@ -141,6 +141,15 @@ class PromoteToUpdates(Promoter):
                     cinfo('            package promote-to-security status (%s) does not match security-signoff status (%s)' % (promote_to_security.status, security_signoff.status), 'yellow')
                     break
 
+                # Check that all snap tasks are either "Invalid" or "Fix Released"
+                snap_done = True
+                for taskname in s.bug.tasks_by_name:
+                    if taskname.startswith('snap-') and s.bug.tasks_by_name[taskname].status not in ['Invalid', 'Fix Released']:
+                        cinfo('            %s is neither "Fix Released" nor "Invalid" (%s)' % (taskname, s.bug.tasks_by_name[taskname].status), 'yellow')
+                        snap_done = False
+                if not snap_done:
+                    break
+
             # All is completed so we can finally close out this workflow bug.
             s.bug.tasks_by_name[s.bug.workflow_project].status = 'Fix Released'
             if promote_to_updates.status == 'Invalid':
-- 
2.14.1





More information about the kernel-team mailing list