Explicit capture exception during create failure

This commit is contained in:
Curtis Castrapel 2018-07-20 10:47:19 -07:00
parent 0a0992fffe
commit 5a01840784
5 changed files with 25 additions and 18 deletions

View File

@ -15,7 +15,7 @@ from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from lemur import database
from lemur.extensions import metrics, signals
from lemur.extensions import metrics, sentry, signals
from lemur.plugins.base import plugins
from lemur.common.utils import generate_private_key, truthiness
@ -247,7 +247,12 @@ def create(**kwargs):
"""
Creates a new certificate.
"""
cert_body, private_key, cert_chain, external_id, csr = mint(**kwargs)
try:
cert_body, private_key, cert_chain, external_id, csr = mint(**kwargs)
except:
current_app.logger.error("Exception minting certificate", exc_info=True)
sentry.captureException()
raise
kwargs['body'] = cert_body
kwargs['private_key'] = private_key
kwargs['chain'] = cert_chain

View File

@ -14,7 +14,7 @@ identify==1.1.3 # via pre-commit
idna==2.7 # via requests
invoke==1.1.0
mccabe==0.6.1 # via flake8
nodeenv==1.3.1
nodeenv==1.3.2
pkginfo==1.4.2 # via twine
pre-commit==1.10.3
pycodestyle==2.3.1 # via flake8

View File

@ -4,10 +4,10 @@
#
# pip-compile --no-index --output-file requirements-docs.txt requirements-docs.in
#
acme==0.26.0
acme==0.26.1
alabaster==0.7.11 # via sphinx
alembic-autogenerate-enums==0.0.2
alembic==0.9.10
alembic==1.0.0
aniso8601==3.0.2
arrow==0.12.1
asn1crypto==0.24.0
@ -15,10 +15,11 @@ asyncpool==1.0
babel==2.6.0 # via sphinx
bcrypt==3.1.4
blinker==1.4
boto3==1.7.56
botocore==1.10.56
boto3==1.7.59
botocore==1.10.59
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.7
cloudflare==2.1.0
cryptography==2.2.2
@ -63,7 +64,7 @@ pycparser==2.18
pygments==2.2.0 # via sphinx
pyjwt==1.6.4
pynacl==1.2.1
pyopenssl==17.2.0
pyopenssl==18.0.0
pyparsing==2.2.0 # via packaging
pyrfc3339==1.1
python-dateutil==2.7.3
@ -72,7 +73,7 @@ pytz==2018.5
pyyaml==3.13
raven[flask]==6.9.0
requests-toolbelt==0.8.0
requests[security]==2.11.1
requests[security]==2.19.1
retrying==1.3.3
s3transfer==0.1.13
six==1.11.0
@ -82,7 +83,8 @@ sphinx==1.7.6
sphinxcontrib-httpdomain==1.7.0
sphinxcontrib-websupport==1.1.0 # via sphinx
sqlalchemy-utils==0.33.3
sqlalchemy==1.2.9
sqlalchemy==1.2.10
tabulate==0.8.2
urllib3==1.23
werkzeug==0.14.1
xmltodict==0.11.0

View File

@ -8,16 +8,16 @@ asn1crypto==0.24.0 # via cryptography
atomicwrites==1.1.5 # via pytest
attrs==18.1.0 # via pytest
aws-xray-sdk==0.95 # via moto
boto3==1.7.59 # via moto
boto3==1.7.61 # via moto
boto==2.49.0 # via moto
botocore==1.10.59 # via boto3, moto, s3transfer
botocore==1.10.61 # via boto3, moto, s3transfer
certifi==2018.4.16 # via requests
cffi==1.11.5 # via cryptography
chardet==3.0.4 # via requests
click==6.7 # via flask
cookies==2.2.1 # via moto, responses
coverage==4.5.1
cryptography==2.2.2 # via moto
cryptography==2.3 # via moto
docker-pycreds==0.3.0 # via docker
docker==3.4.1 # via moto
docutils==0.14 # via botocore
@ -36,7 +36,7 @@ mock==2.0.0 # via moto
more-itertools==4.2.0 # via pytest
moto==1.3.3
nose==1.3.7
pbr==4.1.0 # via mock
pbr==4.1.1 # via mock
pluggy==0.6.0 # via pytest
py==1.5.4 # via pytest
pyaml==17.12.1 # via moto

View File

@ -13,14 +13,14 @@ asn1crypto==0.24.0 # via cryptography
asyncpool==1.0
bcrypt==3.1.4 # via flask-bcrypt, paramiko
blinker==1.4 # via flask-mail, flask-principal, raven
boto3==1.7.59
botocore==1.10.59 # via boto3, s3transfer
boto3==1.7.61
botocore==1.10.61 # via boto3, s3transfer
certifi==2018.4.16
cffi==1.11.5 # via bcrypt, cryptography, pynacl
chardet==3.0.4 # via requests
click==6.7 # via flask
cloudflare==2.1.0
cryptography==2.2.2
cryptography==2.3
dnspython3==1.15.0
dnspython==1.15.0 # via dnspython3
docutils==0.14 # via botocore
@ -51,7 +51,7 @@ marshmallow==2.15.3
mock==2.0.0 # via acme
ndg-httpsclient==0.5.0
paramiko==2.4.1
pbr==4.1.0 # via mock
pbr==4.1.1 # via mock
pem==18.1.0
psycopg2==2.7.5
pyasn1-modules==0.2.2 # via python-ldap