diff options
author | Mattia Rizzolo <mattia@debian.org> | 2016-01-08 13:36:37 +0000 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-01-08 14:45:00 +0100 |
commit | 861760d994b1eac4144a3734ca2e362e3f3a483d (patch) | |
tree | d778e18cba0ad24563eef5a63ab2b67cf7719d93 | |
parent | d434a7621b66d9f48f179b2208256b73de8b163d (diff) | |
download | jenkins.debian.net-861760d994b1eac4144a3734ca2e362e3f3a483d.tar.xz |
common.py: don't fail if JOB_URL is not defined in the env
-rwxr-xr-x | bin/reproducible_common.py | 8 |
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 ' |