diff mbox

[kteam-tools] stable/create-release-tracker: change parsing of bug tasks

Message ID 1306786692-8595-1-git-send-email-herton.krzesinski@canonical.com
State New
Headers show

Commit Message

Herton Ronaldo Krzesinski May 30, 2011, 8:18 p.m. UTC
Current bug_target_name in bug tasks is returning the value of the
project's display_name property. This is breaking create-release-tracker
parsing on main launchpad (production), because the project display name
there contain spaces ('Kernel SRU Workflow'). Fix this by using
display_name property of the kernel-sru-workflow project when getting
the task names for assignment.

Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 stable/create-release-tracker |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

Comments

Steve Conklin June 1, 2011, 6:41 p.m. UTC | #1
Applied 

On Mon, 2011-05-30 at 17:18 -0300, Herton Ronaldo Krzesinski wrote:
> Current bug_target_name in bug tasks is returning the value of the
> project's display_name property. This is breaking create-release-tracker
> parsing on main launchpad (production), because the project display name
> there contain spaces ('Kernel SRU Workflow'). Fix this by using
> display_name property of the kernel-sru-workflow project when getting
> the task names for assignment.
> 
> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
> ---
>  stable/create-release-tracker |   12 +++++-------
>  1 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/stable/create-release-tracker b/stable/create-release-tracker
> index d188573..476c29e 100755
> --- a/stable/create-release-tracker
> +++ b/stable/create-release-tracker
> @@ -226,15 +226,13 @@ class CreateTrackingBug(StdApp):
>              #
>              for t in bug.tasks:
>                  task       = t.bug_target_name
> -                parts = task.split()
> -                mastertask = parts[0]
> -                if len(parts) == 1:
> -                    if mastertask == 'kernel-sru-workflow':
> -                        t.status = "In Progress"
> +                parts = task.partition(proj.display_name)
> +                if parts[0] == '' and parts[1] == proj.display_name and parts[2] == '':
> +                    t.status = "In Progress"
>                  else:
> -                    if mastertask == 'linux':
> +                    if parts[0] != '':
>                          continue
> -                    task = parts[1]
> +                    task = parts[2].strip()
>                      if task in taskAssignments:
>                          t.assignee = self.lp.launchpad.people[taskAssignments[task]]
>                      else:
> -- 
> 1.7.4.1
> 
>
diff mbox

Patch

diff --git a/stable/create-release-tracker b/stable/create-release-tracker
index d188573..476c29e 100755
--- a/stable/create-release-tracker
+++ b/stable/create-release-tracker
@@ -226,15 +226,13 @@  class CreateTrackingBug(StdApp):
             #
             for t in bug.tasks:
                 task       = t.bug_target_name
-                parts = task.split()
-                mastertask = parts[0]
-                if len(parts) == 1:
-                    if mastertask == 'kernel-sru-workflow':
-                        t.status = "In Progress"
+                parts = task.partition(proj.display_name)
+                if parts[0] == '' and parts[1] == proj.display_name and parts[2] == '':
+                    t.status = "In Progress"
                 else:
-                    if mastertask == 'linux':
+                    if parts[0] != '':
                         continue
-                    task = parts[1]
+                    task = parts[2].strip()
                     if task in taskAssignments:
                         t.assignee = self.lp.launchpad.people[taskAssignments[task]]
                     else: