From: Joerg Jaspert Date: Wed, 6 Aug 2008 22:31:06 +0000 (+0200) Subject: Error out when we are unable to find a source id for a file we want to install. Shoul... X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=eb12fb9bda328b5c63a21a9a915d284cd1c55a17;p=dak.git Error out when we are unable to find a source id for a file we want to install. Shouldnt happen. --- diff --git a/ChangeLog b/ChangeLog index 05563966..b6b1ac90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-07 Joerg Jaspert + + * dak/process_accepted.py (install): Error out with the new + exception if we dont know the source package for a file we want to + install. Shouldn't ever hit us, but better safe than sorry. + + * daklib/dak_exceptions.py (dakerrors): new exception - no source field. + 2008-08-05 Joerg Jaspert * config/debian/cron.unchecked: disable the ssh-move insanity (and diff --git a/dak/process_accepted.py b/dak/process_accepted.py index e99c35b3..94c2ea30 100755 --- a/dak/process_accepted.py +++ b/dak/process_accepted.py @@ -35,6 +35,7 @@ from daklib import database from daklib import logging from daklib import queue from daklib import utils +from daklib.dak_exceptions import * ############################################################################### @@ -354,8 +355,7 @@ def install (): projectB.query("INSERT INTO binaries (package, version, maintainer, source, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, %d, '%s', %d)" % (package, version, maintainer_id, source_id, architecture_id, files[file]["files id"], type, fingerprint_id)) else: - projectB.query("INSERT INTO binaries (package, version, maintainer, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %d)" - % (package, version, maintainer_id, architecture_id, files[file]["files id"], type, fingerprint_id)) + raise NoSourceFieldError, "Unable to find a source id for %s (%s), %s, file %s, type %s, signed by %s" % (package, version, architecture, file, type, sig_fpr) for suite in changes["distribution"].keys(): suite_id = database.get_suite_id(suite) projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id)) diff --git a/daklib/dak_exceptions.py b/daklib/dak_exceptions.py index b52e0657..4e795461 100644 --- a/daklib/dak_exceptions.py +++ b/daklib/dak_exceptions.py @@ -48,7 +48,8 @@ dakerrors = { "FileExistsError": """Exception raised when destination file exists.""", "SendmailFailedError": """Exception raised when Sendmail invocation failed.""", "NoFreeFilenameError": """Exception raised when no alternate filename was found.""", - "TransitionsError": """Exception raised when transitions file can't be parsed.""" + "TransitionsError": """Exception raised when transitions file can't be parsed.""", + "NoSourceFieldError": """Exception raised - we cant find the source - wtf?""" } def construct_dak_exception(name, description):