Allow the build node AMI to be overridden in config

This commit is contained in:
Joseph Schorr 2016-06-22 15:13:54 -04:00
parent a2cb30246d
commit 61695eb439

View file

@ -111,9 +111,12 @@ class EC2Executor(BuilderExecutor):
@coroutine
def start_builder(self, realm, token, build_uuid):
region = self.executor_config['EC2_REGION']
channel = self.executor_config.get('COREOS_CHANNEL', 'stable')
get_ami_callable = partial(self._get_coreos_ami, region, channel)
coreos_ami = yield From(self._loop.run_in_executor(None, get_ami_callable))
coreos_ami = self.executor_config.get('COREOS_AMI', None)
if coreos_ami is None:
channel = self.executor_config.get('COREOS_CHANNEL', 'stable')
get_ami_callable = partial(self._get_coreos_ami, region, channel)
coreos_ami = yield From(self._loop.run_in_executor(None, get_ami_callable))
user_data = self.generate_cloud_config(realm, token, channel, self.manager_hostname)
logger.debug('Generated cloud config: %s', user_data)