sponsor-patch: Handle staging environment branch URLs

This commit is contained in:
Stefano Rivera 2012-11-06 23:51:59 +02:00
parent 925e1c787e
commit a9c0df9627

View File

@ -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))