From fd70f9837c99789d934987216c32612d8de1c49d Mon Sep 17 00:00:00 2001 From: InitHello Date: Sun, 23 Feb 2014 23:19:22 -0500 Subject: [PATCH] Fix pep8. --- master/buildbot/buildslave/ec2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 master/buildbot/buildslave/ec2.py diff --git a/master/buildbot/buildslave/ec2.py b/master/buildbot/buildslave/ec2.py old mode 100644 new mode 100755 index 336b0c7e4be..527958a6c9a --- a/master/buildbot/buildslave/ec2.py +++ b/master/buildbot/buildslave/ec2.py @@ -60,7 +60,7 @@ def __init__(self, name, password, instance_type, ami=None, build_wait_timeout=60 * 10, properties={}, locks=None, spot_instance=False, max_spot_price=1.6, volumes=[], placement=None, price_multiplier=1.2, retry=1, - retry_price_adjustment=1): + retry_price_adjustment=1, product_description='Linux/UNIX'): AbstractLatentBuildSlave.__init__( self, name, password, max_builds, notify_on_missing, @@ -101,6 +101,7 @@ def __init__(self, name, password, instance_type, ami=None, self.retry_price_adjustment = retry_price_adjustment self.retry = retry self.attempt = 1 + self.product_description = product_description if None not in [placement, region]: self.placement = '%s%s' % (region, placement) else: @@ -333,7 +334,7 @@ def _submit_request(self): timestamp_yesterday = time.gmtime(int(time.time() - 86400)) spot_history_starttime = time.strftime('%Y-%m-%dT%H:%M:%SZ', timestamp_yesterday) spot_prices = self.conn.get_spot_price_history(start_time=spot_history_starttime, - product_description='Linux/UNIX', + product_description=self.product_description, availability_zone=self.placement) price_sum = 0.0 price_count = 0 @@ -387,7 +388,7 @@ def _request_spot_instance(self): (self.__class__.__name__, self.slavename, self.retry)) raise interfaces.LatentBuildSlaveFailedToSubstantiate() else: - instance_id, image_id, start_time, success = self._submit_request() + instance_id, image_id, start_time, success = self._submit_request() if not success: raise interfaces.LatentBuildSlaveFailedToSubstantiate() return instance_id, image_id, start_time