Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle error when the CRL is not writable.

  • Loading branch information...
commit 8189ac8bbf24594b1d380d721c401e011c5c8c24 1 parent 2a06db1
@ralphbean authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 fedmsg/crypto.py
View
6 fedmsg/crypto.py
@@ -142,6 +142,7 @@
import fedmsg.encoding
import logging
+log = logging.getLogger('fedmsg')
try:
import M2Crypto
@@ -150,7 +151,6 @@
import m2ext
except ImportError, e:
logging.basicConfig()
- log = logging.getLogger('fedmsg')
log.warn("Crypto disabled %r" % e)
@@ -197,7 +197,6 @@ def validate(message, ssldir, **config):
"""
def fail(reason):
- log = logging.getLogger('fedmsg')
log.warn("Failed validation. %s" % reason)
return False
@@ -332,7 +331,8 @@ def _load_crl(crl_location="https://fedoraproject.org/fedmsg/crl.pem",
with open(crl_cache, 'w') as f:
f.write(response.content)
except requests.exceptions.ConnectionError:
- log = logging.getLogger('fedmsg')
log.warn("Could not access %r" % crl_location)
+ except IOError as e:
+ log.warn("Could not write %r. %r" % (crl_cache, e))
return M2Crypto.X509.load_crl(crl_cache)
Please sign in to comment.
Something went wrong with that request. Please try again.