Ensuring that we don't fail cleaning if it doesn't exist. (#708)
This commit is contained in:
parent
c46fa5d69c
commit
b715687617
|
@ -24,6 +24,9 @@ def retry_throttled(exception):
|
||||||
if exception.response['Error']['Code'] == 'NoSuchEntity':
|
if exception.response['Error']['Code'] == 'NoSuchEntity':
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if isinstance(exception, botocore.errorfactory.NoSuchEntityException):
|
||||||
|
return False
|
||||||
|
|
||||||
metrics.send('iam_retry', 'counter', 1)
|
metrics.send('iam_retry', 'counter', 1)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -93,7 +96,11 @@ def delete_cert(cert_name, **kwargs):
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
client = kwargs.pop('client')
|
client = kwargs.pop('client')
|
||||||
client.delete_server_certificate(ServerCertificateName=cert_name)
|
try:
|
||||||
|
client.delete_server_certificate(ServerCertificateName=cert_name)
|
||||||
|
except botocore.exceptions.ClientError as e:
|
||||||
|
if e.response['Error']['Code'] != 'NoSuchEntity':
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
@sts_client('iam')
|
@sts_client('iam')
|
||||||
|
|
Loading…
Reference in New Issue