From 861760d994b1eac4144a3734ca2e362e3f3a483d Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 8 Jan 2016 13:36:37 +0000 Subject: common.py: don't fail if JOB_URL is not defined in the env --- bin/reproducible_common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin/reproducible_common.py') 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(""" """) -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 ' JOB_FOOTER += JOB_NAME+' which is configured via this ' -- cgit v1.2.3-54-g00ecf