upon creating a new destination, we also add it as source, if the plugin defines this as an option
This commit is contained in:
parent
d7abf2ec18
commit
69c00c4db5
|
@ -12,7 +12,7 @@ from lemur import database
|
||||||
from lemur.models import certificate_destination_associations
|
from lemur.models import certificate_destination_associations
|
||||||
from lemur.destinations.models import Destination
|
from lemur.destinations.models import Destination
|
||||||
from lemur.certificates.models import Certificate
|
from lemur.certificates.models import Certificate
|
||||||
from lemur.sources import service as sources_service
|
from lemur.sources.service import add_aws_destination_to_sources
|
||||||
|
|
||||||
|
|
||||||
def create(label, plugin_name, options, description=None):
|
def create(label, plugin_name, options, description=None):
|
||||||
|
@ -33,8 +33,7 @@ def create(label, plugin_name, options, description=None):
|
||||||
current_app.logger.info("Destination: %s created", label)
|
current_app.logger.info("Destination: %s created", label)
|
||||||
|
|
||||||
# add the destination as source, to avoid new destinations that are not in source, as long as an AWS destination
|
# add the destination as source, to avoid new destinations that are not in source, as long as an AWS destination
|
||||||
if plugin_name == 'aws-destination':
|
if add_aws_destination_to_sources(destination):
|
||||||
sources_service.create(label=label, plugin_name='aws-source', options=options, description=description)
|
|
||||||
current_app.logger.info("Source: %s created", label)
|
current_app.logger.info("Source: %s created", label)
|
||||||
|
|
||||||
return database.create(destination)
|
return database.create(destination)
|
||||||
|
|
Loading…
Reference in New Issue