Skip to content

Commit

Permalink
Merge pull request #39 from JAVGan/warn
Browse files Browse the repository at this point in the history
AWS: Add a warning when the filter returns >1 imgs
  • Loading branch information
rohanpm authored Nov 10, 2024
2 parents 6472e9e + 07db13d commit 1df18a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cloudimg/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ def get_image_by_filters(self, filters):

if not images:
return None
elif len(images) > 1:
amis = [x['ImageId'] for x in images]
log.warning(
"Filtered more than one image: %s",
", ".join(amis),
)

return self.ec2.Image(images[0]['ImageId'])

Expand Down

0 comments on commit 1df18a2

Please sign in to comment.