Fixing up some of the sync related code

This commit is contained in:
kevgliss
2015-08-03 13:51:27 -07:00
parent 0360ccc666
commit 7d169f7c4c
10 changed files with 66 additions and 42 deletions

View File

@ -279,4 +279,4 @@ class Certificate(db.Model):
@event.listens_for(Certificate.destinations, 'append')
def update_destinations(target, value, initiator):
destination_plugin = plugins.get(value.plugin_name)
destination_plugin.upload(target.body, target.private_key, target.chain, value.options)
destination_plugin.upload(target.name, target.body, target.private_key, target.chain, value.options)

View File

@ -135,10 +135,10 @@ def import_certificate(**kwargs):
"""
from lemur.users import service as user_service
from lemur.notifications import service as notification_service
cert = Certificate(kwargs['public_certificate'])
cert = Certificate(kwargs['public_certificate'], chain=kwargs['intermediate_certificate'])
# TODO future source plugins might have a better understanding of who the 'owner' is we should support this
cert.owner = kwargs.get('owner', current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL'))
cert.owner = kwargs.get('owner', current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL')[0])
cert.creator = kwargs.get('creator', user_service.get_by_email('lemur@nobody'))
# NOTE existing certs may not follow our naming standard we will