Adding better error handling around certificate rotation (#562)

This commit is contained in:
kevgliss
2016-12-05 15:12:55 -08:00
committed by GitHub
parent 9030aed8a4
commit e622a49b72
3 changed files with 11 additions and 3 deletions

View File

@ -372,9 +372,9 @@ class CertificatesUpload(AuthenticatedResource):
:statuscode 200: no error
"""
data['creator'] = g.user
if data.get('destinations'):
if data.get('private_key'):
data['creator'] = g.user
return service.upload(**data)
else:
raise Exception("Private key must be provided in order to upload certificate to AWS")