[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] daklib/command.py: strip whitespace from fingerprint



This allows copying the fingerprint from the gpg output without any
editing.
---
 daklib/command.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/daklib/command.py b/daklib/command.py
index 88f6555..cbaffa8 100644
--- a/daklib/command.py
+++ b/daklib/command.py
@@ -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)
-- 
1.7.2.5



Reply to: