From 61695eb4390d46d8b24e8563b19e1a413b4ad57c Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 22 Jun 2016 15:13:54 -0400 Subject: [PATCH] Allow the build node AMI to be overridden in config --- buildman/manager/executor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildman/manager/executor.py b/buildman/manager/executor.py index 3e6034f0d..d2e12f009 100644 --- a/buildman/manager/executor.py +++ b/buildman/manager/executor.py @@ -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)