Updating redshift.describe_cluster_snapshots to return multiple snapshots for cluster_identifier (#2216)

This commit is contained in:
Dan Chan 2019-05-23 04:01:47 -04:00 committed by Terry Cain
commit 2a5f7e15a7
2 changed files with 29 additions and 11 deletions

View file

@ -640,9 +640,12 @@ class RedshiftBackend(BaseBackend):
def describe_cluster_snapshots(self, cluster_identifier=None, snapshot_identifier=None):
if cluster_identifier:
cluster_snapshots = []
for snapshot in self.snapshots.values():
if snapshot.cluster.cluster_identifier == cluster_identifier:
return [snapshot]
cluster_snapshots.append(snapshot)
if cluster_snapshots:
return cluster_snapshots
raise ClusterNotFoundError(cluster_identifier)
if snapshot_identifier: