summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.py
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@debian.org>2016-01-08 13:36:37 +0000
committerHolger Levsen <holger@layer-acht.org>2016-01-08 14:45:00 +0100
commit861760d994b1eac4144a3734ca2e362e3f3a483d (patch)
treed778e18cba0ad24563eef5a63ab2b67cf7719d93 /bin/reproducible_common.py
parentd434a7621b66d9f48f179b2208256b73de8b163d (diff)
downloadjenkins.debian.net-861760d994b1eac4144a3734ca2e362e3f3a483d.tar.xz
common.py: don't fail if JOB_URL is not defined in the env
Diffstat (limited to 'bin/reproducible_common.py')
-rwxr-xr-xbin/reproducible_common.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 01e5332f..ab9baf73 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -136,10 +136,12 @@ html_header = Template("""<!DOCTYPE html>
</head>
<body $padding>""")
-if os.environ['JOB_URL'] == '':
- JOB_FOOTER=''
-else:
+try:
JOB_URL = os.environ['JOB_URL']
+except KeyError
+ JOB_URL = ''
+ JOB_FOOTER = ''
+else:
JOB_NAME = os.path.basename(JOB_URL[:-1])
JOB_FOOTER = 'This page was built by the jenkins job <a href="'+JOB_URL+'">'
JOB_FOOTER += JOB_NAME+'</a> which is configured via this '