diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-01-18 10:59:29 +0100 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2015-01-19 18:07:31 +0100 |
commit | 30679ab6a81684b380653637e4f2a5fe31a15cae (patch) | |
tree | 93e1dc92da54de81fb22d24f0c36f5982545f68f | |
parent | de644c6630470d3cda91feb365a88668ad4e0192 (diff) | |
download | jenkins.debian.net-30679ab6a81684b380653637e4f2a5fe31a15cae.tar.xz |
reproducible: _html_packages: better handling of exceptions
-rwxr-xr-x | bin/reproducible_common.py | 8 | ||||
-rwxr-xr-x | bin/reproducible_html_packages.py | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 8b958b8c..b7f764fc 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -171,6 +171,12 @@ html_foot_page_style_note = Template((tab*2).join(""" url2html = re.compile(r'((mailto\:|((ht|f)tps?)\://|file\:///){1}\S+)') +def print_critical_message(msg): + print('\n\n\n') + for line in msg.splitlines(): + log.critical(line) + print('\n\n\n') + def write_html_page(title, body, destfile, noheader=False, style_note=False, noendpage=False): now = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M UTC') html = '' @@ -215,7 +221,7 @@ def start_udd_connection(): " host=" + host + " password=" + password) except: - log.error("Erorr connecting to the UDD database replica") + print_critical_message("Erorr connecting to the UDD database replica") raise conn.set_client_encoding('utf8') return conn diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index 2cb4b0c7..28850f39 100755 --- a/bin/reproducible_html_packages.py +++ b/bin/reproducible_html_packages.py @@ -64,7 +64,9 @@ def check_package_status(package): 'WHERE name="%s"' % package result = query_db(query)[0] except IndexError: - log.critical('The query produces no results. The query: ' + query) + print_critical_message('This query produces no results: ' + query + + '\nThis means there is no tested package with the name ' + + package + '.') raise status = str(result[0]) version = str(result[1]) |