[buildinfo.debian.net] 04/08: Wrap the part of update_or_create_key that can fail.
Chris Lamb
chris at chris-lamb.co.uk
Fri Nov 4 11:08:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository buildinfo.debian.net.
commit 676fba862607ddbdc7b1a4d3ca7fde8e49d21df3
Author: Chris Lamb <lamby at debian.org>
Date: Fri Nov 4 11:01:35 2016 +0000
Wrap the part of update_or_create_key that can fail.
Signed-off-by: Chris Lamb <lamby at debian.org>
---
bidb/keys/tasks.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/bidb/keys/tasks.py b/bidb/keys/tasks.py
index fcca3f7..5c49fd9 100644
--- a/bidb/keys/tasks.py
+++ b/bidb/keys/tasks.py
@@ -10,12 +10,16 @@ from .models import Key
@celery.task(soft_time_limit=60)
def update_or_create_key(uid):
with TemporaryDirectory() as homedir:
- check_output2((
- 'gpg',
- '--homedir', homedir,
- '--keyserver', 'http://p80.pool.sks-keyservers.net/',
- '--recv-keys', uid,
- ))
+ try:
+ check_output2((
+ 'gpg',
+ '--homedir', homedir,
+ '--keyserver', 'http://p80.pool.sks-keyservers.net/',
+ '--recv-keys', uid,
+ ))
+ except subprocess.CalledProcessError as exc:
+ print "E: {}: {}".format(exc, exc.output)
+ return None, False
data = check_output2((
'gpg',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/buildinfo.debian.net.git
More information about the Reproducible-commits
mailing list