Source syncing tweaks. (#705)

* Allow owner to be specified when syncing certs.

* Ensuring non-endpoint plugins don't fail to complete syncing.

* Adding in some additional error handling.
This commit is contained in:
kevgliss
2017-03-03 14:53:56 -08:00
committed by GitHub
parent d53f64890c
commit fc957b63ff
4 changed files with 8 additions and 5 deletions

View File

@ -67,7 +67,7 @@ def sync_endpoints(source):
endpoints = s.get_endpoints(source.options)
except NotImplementedError:
current_app.logger.warning("Unable to sync endpoints for source {0} plugin has not implemented 'get_endpoints'".format(source.label))
return
return new, updated
for endpoint in endpoints:
exists = endpoint_service.get_by_dnsname(endpoint['dnsname'])
@ -114,7 +114,9 @@ def sync_certificates(source, user):
for certificate in certificates:
exists = certificate_service.get_by_name(certificate['name'])
certificate['owner'] = user.email
if not certificate.get('owner'):
certificate['owner'] = user.email
certificate['creator'] = user
if not exists: