From: Ansgar Burchardt Date: Sat, 22 Sep 2012 08:43:46 +0000 (+0200) Subject: daklib/command.py: give a real error message for unknown fingerprints X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=5de72deeb2e24489d3324a531e00a42d44327e12;p=dak.git daklib/command.py: give a real error message for unknown fingerprints --- diff --git a/daklib/command.py b/daklib/command.py index fcf4cbb3..451c6b1f 100644 --- a/daklib/command.py +++ b/daklib/command.py @@ -198,7 +198,9 @@ class CommandFile(object): acl = session.query(ACL).filter_by(name=acl_name).one() fpr_hash = section['Fingerprint'].translate(None, ' ') - fpr = session.query(Fingerprint).filter_by(fingerprint=fpr_hash).one() + fpr = session.query(Fingerprint).filter_by(fingerprint=fpr_hash).first() + if fpr is None: + raise CommandError('Unknown fingerprint {0}'.format(fpr_hash)) if fpr.keyring is None or fpr.keyring.keyring_name not in cnf.value_list('Command::DM::Keyrings'): raise CommandError('Key {0} is not in DM keyring.'.format(fpr.fingerprint)) addresses = gpg_get_key_addresses(fpr.fingerprint)