Mercurial > public > mercurial-scm > hg-stable
diff contrib/automation/hgautomation/aws.py @ 42302:730edbd836d8
automation: only iterate over our AMIs
We can't delete AMIs that we don't own. Iterating over other
AMIs won't work and slows down execution.
Differential Revision: https://phab.mercurial-scm.org/D6283
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 19 Apr 2019 05:07:44 -0700 |
parents | 0e9066db5e44 |
children | fcb97cb91ff8 |
line wrap: on
line diff
--- a/contrib/automation/hgautomation/aws.py Wed May 01 15:34:03 2019 -0700 +++ b/contrib/automation/hgautomation/aws.py Fri Apr 19 05:07:44 2019 -0700 @@ -490,7 +490,7 @@ terminate_ec2_instances(ec2resource, prefix=prefix) - for image in ec2resource.images.all(): + for image in ec2resource.images.filter(Owners=['self']): if image.name.startswith(prefix): remove_ami(ec2resource, image)