better handling of destination plugin errors, and also checking cert expiration before upload
This commit is contained in:
parent
eb48e2fe75
commit
697215f8bc
|
@ -445,6 +445,9 @@ def update_destinations(target, value, initiator):
|
||||||
"""
|
"""
|
||||||
destination_plugin = plugins.get(value.plugin_name)
|
destination_plugin = plugins.get(value.plugin_name)
|
||||||
status = FAILURE_METRIC_STATUS
|
status = FAILURE_METRIC_STATUS
|
||||||
|
|
||||||
|
if target.expired:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
if target.private_key or not destination_plugin.requires_key:
|
if target.private_key or not destination_plugin.requires_key:
|
||||||
destination_plugin.upload(
|
destination_plugin.upload(
|
||||||
|
|
|
@ -325,6 +325,7 @@ class AWSDestinationPlugin(DestinationPlugin):
|
||||||
]
|
]
|
||||||
|
|
||||||
def upload(self, name, body, private_key, cert_chain, options, **kwargs):
|
def upload(self, name, body, private_key, cert_chain, options, **kwargs):
|
||||||
|
try:
|
||||||
iam.upload_cert(
|
iam.upload_cert(
|
||||||
name,
|
name,
|
||||||
body,
|
body,
|
||||||
|
@ -333,6 +334,8 @@ class AWSDestinationPlugin(DestinationPlugin):
|
||||||
cert_chain=cert_chain,
|
cert_chain=cert_chain,
|
||||||
account_number=self.get_option("accountNumber", options),
|
account_number=self.get_option("accountNumber", options),
|
||||||
)
|
)
|
||||||
|
except ClientError:
|
||||||
|
sentry.captureException()
|
||||||
|
|
||||||
def deploy(self, elb_name, account, region, certificate):
|
def deploy(self, elb_name, account, region, certificate):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue