[Qa-jenkins-scm] [jenkins.debian.net] 05/06: reproducible: notes: do not fail the job when the version is missing

Holger Levsen holger at moszumanska.debian.org
Tue Aug 18 11:36:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit f5b51adf4fe89a443ef6f3c49e05a3e75be60722
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Mon Aug 17 10:42:03 2015 +0000

    reproducible: notes: do not fail the job when the version is missing
---
 bin/reproducible_notes.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/bin/reproducible_notes.py b/bin/reproducible_notes.py
index 872cf20..15921b7 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 \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list