From a9c0df9627401a8c891cceb45c07b22c4ea4c85d Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 6 Nov 2012 23:51:59 +0200 Subject: [PATCH] sponsor-patch: Handle staging environment branch URLs --- ubuntutools/sponsor_patch/sponsor_patch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ubuntutools/sponsor_patch/sponsor_patch.py b/ubuntutools/sponsor_patch/sponsor_patch.py index cad03bd..bd308d2 100644 --- a/ubuntutools/sponsor_patch/sponsor_patch.py +++ b/ubuntutools/sponsor_patch/sponsor_patch.py @@ -192,6 +192,9 @@ def get_open_ubuntu_bug_task(launchpad, bug, branch=None): ubuntu_tasks = [x for x in bug_tasks if x.is_ubuntu_task()] if branch: branch = branch.split('/') + # Non-production LP? + if len(branch) > 5: + branch = branch[3:] if len(ubuntu_tasks) == 0: Logger.error("No Ubuntu bug task found on bug #%i." % (bug.id))