From f5b51adf4fe89a443ef6f3c49e05a3e75be60722 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Mon, 17 Aug 2015 10:42:03 +0000 Subject: reproducible: notes: do not fail the job when the version is missing --- bin/reproducible_notes.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'bin/reproducible_notes.py') diff --git a/bin/reproducible_notes.py b/bin/reproducible_notes.py index 872cf201..15921b72 100755 --- a/bin/reproducible_notes.py +++ b/bin/reproducible_notes.py @@ -40,7 +40,6 @@ def load_notes(): assert 'version' in original[pkg] except AssertionError: print_critical_message(pkg + ' did not include a version') - raise query = 'SELECT s.id, s.version, s.suite ' + \ 'FROM results AS r JOIN sources AS s ON r.package_id=s.id' + \ ' WHERE s.name="{pkg}" AND r.status != ""' + \ @@ -58,11 +57,17 @@ def load_notes(): for suite in result: pkg_details = {} # https://image-store.slidesharecdn.com/c2c44a06-5e28-4296-8d87-419529750f6b-original.jpeg - if version_compare(str(original[pkg]['version']), - str(suite[1])) > 0: - continue + try: + if version_compare(str(original[pkg]['version']), + str(suite[1])) > 0: + continue + except KeyError: + pass pkg_details['suite'] = suite[2] - pkg_details['version'] = original[pkg]['version'] + try: + pkg_details['version'] = original[pkg]['version'] + except KeyError: + pkg_details['version'] = '' pkg_details['comments'] = original[pkg]['comments'] if \ 'comments' in original[pkg] else None pkg_details['bugs'] = original[pkg]['bugs'] if \ -- cgit v1.2.3-70-g09d2