in lambda/snapshots_tool_utils.py [0:0]
def filter_clusters(pattern, cluster_list):
# Takes the response from describe-db-clusters and filters according to pattern in DBClusterIdentifier
filtered_list = []
for cluster in cluster_list['DBClusters']:
if pattern == 'ALL_CLUSTERS' and cluster['Engine'] in _SUPPORTED_ENGINES:
filtered_list.append(cluster)
else:
match = re.search(pattern, cluster['DBClusterIdentifier'])
if match and cluster['Engine'] in _SUPPORTED_ENGINES:
filtered_list.append(cluster)
return filtered_list