From 463d1f63a8d9784f6df072abce5af773ddad1c0c Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Thu, 21 Nov 2019 16:20:02 +0100 Subject: [PATCH] requestbackport: Error out nicely when a tracking project doens't exist. LP: #1852901 Signed-off-by: Mattia Rizzolo --- debian/changelog | 2 ++ requestbackport | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1ca0bb9..5da5c1c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ ubuntu-dev-tools (0.175) UNRELEASED; urgency=medium [ Mattia Rizzolo ] * Trust the installed debian-keyring when checking validity of dsc signatures. + * requestbackport: + + Error out nicely when a tracking project doens't exist. LP: #1852901 [ Stefano Rivera ] * merge-changelog: rewrite the changelog handling to use python3-debian. diff --git a/requestbackport b/requestbackport index 555610d..e660f51 100755 --- a/requestbackport +++ b/requestbackport @@ -90,7 +90,14 @@ def check_existing(package, destinations): query = re.findall(r'[a-z]+', package) bugs = [] for release in destinations: - project = Launchpad.projects[release + '-backports'] + project_name = '{}-backports'.format(release) + try: + project = Launchpad.projects[project_name] + except KeyError: + Logger.error("The backports tracking project '%s' doesn't seem to " + "exist. Please check the situation with the " + "backports team.", project_name) + sys.exit(1) bugs += project.searchTasks(omit_duplicates=True, search_text=query, status=["Incomplete", "New", "Confirmed",