Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-rosset committed Feb 18, 2022
1 parent 9428cbc commit d9cb5fa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions aws/terminator/data_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import botocore.exceptions

from . import DbTerminator, Terminator, get_tag_dict_from_tag_list
from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code


class DmsSubnetGroup(DbTerminator):
Expand Down Expand Up @@ -317,12 +316,10 @@ def get_available_clusters(client):
domain_config = client.describe_domain_config(DomainName=domain['DomainName'])
domain_status["CreationDate"] = domain_config['DomainConfig']['Status']['CreationDate']
domains.append(domain_status)
except is_boto3_error_code('ResourceNotFoundException'):
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError): # pylint: disable=duplicate-except
# Unlikely, but possible. The domain may have been deleted after invoking
# list_domain_names().
pass
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError): # pylint: disable=duplicate-except
pass
return domains

return Terminator._create(credentials, OpenSearch, 'opensearch', get_available_clusters)
Expand Down

0 comments on commit d9cb5fa

Please sign in to comment.