From 5de72deeb2e24489d3324a531e00a42d44327e12 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Sat, 22 Sep 2012 10:43:46 +0200 Subject: [PATCH] daklib/command.py: give a real error message for unknown fingerprints --- daklib/command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5