summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-08 20:17:32 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-08 20:38:31 +0100
commitb2139f7182417975fa6e5c3f5b342d5f00599708 (patch)
tree7a54a0f9e9a9d0d7a75691478ffe10ac60a7de90
parent7b7e98a98f42ae4c6b6069eb13d75ecff2e54d1c (diff)
downloadjenkins.debian.net-b2139f7182417975fa6e5c3f5b342d5f00599708.tar.xz
reproducible: html_notes: fix KeyError in case a issue does not affect any package
-rwxr-xr-xbin/reproducible_html_notes.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index b6b6f103..01c7a516 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -224,9 +224,12 @@ def gen_html_issue(issue):
url = ''
# add affected packages:
affected = ''
- for pkg in sorted(issues_count[issue]):
- affected += tab*6 + '<a href="%s/%s.html" class="noted">%s</a>\n' % (
- RB_PKG_URI, pkg, pkg)
+ try:
+ for pkg in sorted(issues_count[issue]):
+ affected += tab*6 + '<a href="%s/%s.html" class="noted">%s</a>\n' \
+ % (RB_PKG_URI, pkg, pkg)
+ except KeyError: # The note is not listed in any package, that is
+ affected = '<i>None</i>'
# check for description:
try:
desc = issues[issue]['description']