Bug 1085520 - Support instance-store backed AMIs for builders. Bustage
authorRail Aliiev <rail@mozilla.com>
Thu, 27 Nov 2014 10:48:44 -0500
changeset 573 19950769cf2deb69159af1043d6f6a5f63e92a2b
parent 572 537f60754ef49e9599703ccd5c9c7ebe176a2bca
child 574 cca685fb1f2c4a99c0b926748cc29e6e8e1580e7
push id564
push userraliiev@mozilla.com
push dateThu, 27 Nov 2014 15:48:48 +0000
bugs1085520
Bug 1085520 - Support instance-store backed AMIs for builders. Bustage
cloudtools/aws/ami.py
scripts/aws_watch_pending.py
--- a/cloudtools/aws/ami.py
+++ b/cloudtools/aws/ami.py
@@ -155,17 +155,17 @@ def delete_old_amis(region, tags, keep_l
             amis_to_delete = amis[:-keep_last]
 
         for a in amis_to_delete:
             delete_ami(a, dry_run)
     else:
         log.info("Nothing to delete")
 
 
-def get_spot_ami(region, moz_instance_type, root_device_type=None):
+def get_ami(region, moz_instance_type, root_device_type=None):
     """Returns a list of AMIs sorted by creation time, reversed.
     root_device type can be either "ebs" or "instance-store"
     virtualization_type can be either "hvm" or "paravirtual"""
     spot_amis = get_spot_amis(region=region,
                               tags={"moz-type": moz_instance_type},
                               root_device_type=root_device_type)
     last_ami = spot_amis[-1]
     return last_ami
--- a/scripts/aws_watch_pending.py
+++ b/scripts/aws_watch_pending.py
@@ -16,17 +16,17 @@ except ImportError:
 
 from boto.exception import BotoServerError, EC2ResponseError
 from boto.ec2.networkinterface import NetworkInterfaceCollection, \
     NetworkInterfaceSpecification
 
 import site
 site.addsitedir(os.path.join(os.path.dirname(__file__), ".."))
 
-from cloudtools.aws import (get_aws_connection,  aws_get_running_instances,
+from cloudtools.aws import (get_aws_connection, aws_get_running_instances,
                             aws_get_all_instances, filter_spot_instances,
                             filter_ondemand_instances, reduce_by_freshness,
                             distribute_in_region, load_instance_config,
                             jacuzzi_suffix)
 from cloudtools.aws.spot import get_spot_requests_for_moztype, \
     usable_spot_choice, get_available_slave_name, get_spot_choices
 from cloudtools.jacuzzi import filter_instances_by_slaveset
 from cloudtools.aws.ami import get_ami