X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fcommand.py;fp=daklib%2Fcommand.py;h=451c6b1f69bd2a6ecab7620f5e8f85300c0eb0b9;hb=5de72deeb2e24489d3324a531e00a42d44327e12;hp=fcf4cbb391613df242762e022453af3cbd714a23;hpb=3ec91e0bb78ac0603c06d152524b3877948662de;p=dak.git 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)