]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/command.py: strip whitespace from fingerprint
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 20 Sep 2012 11:14:29 +0000 (13:14 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 20 Sep 2012 11:14:29 +0000 (13:14 +0200)
This allows copying the fingerprint from the gpg output without any
editing.

daklib/command.py

index 88f65558c5e9659fe31da57acd4c95a4e7fa4c4b..cbaffa8f3a206f2094fb298604ddec3eb94d761d 100644 (file)
@@ -191,7 +191,8 @@ class CommandFile(object):
         acl_name = cnf.get('Command::DM::ACL', 'dm')
         acl = session.query(ACL).filter_by(name=acl_name).one()
 
-        fpr = session.query(Fingerprint).filter_by(fingerprint=section['Fingerprint']).one()
+        fpr_hash = section['Fingerprint'].translate(None, ' ')
+        fpr = session.query(Fingerprint).filter_by(fingerprint=fpr_hash).one()
         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)