Skip to content

Commit

Permalink
OpenStackLatentWorker: Make nova_args renderable
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Nov 20, 2020
1 parent d825eed commit bebb5f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions master/buildbot/worker/openstack.py
Expand Up @@ -249,6 +249,7 @@ def _getFlavor(self, build):
def renderWorkerProps(self, build):
image = yield self._getImage(build)
flavor = yield self._getFlavor(build)
nova_args = yield build.render(self.nova_args)

if self.block_devices is not None:
block_devices = []
Expand All @@ -257,24 +258,24 @@ def renderWorkerProps(self, build):
block_devices.append(rendered_block_device)
else:
block_devices = None
return (image, flavor, block_devices)
return (image, flavor, block_devices, nova_args)

@defer.inlineCallbacks
def start_instance(self, build):
if self.instance is not None:
raise ValueError('instance active')

image, flavor, block_devices = yield self.renderWorkerPropsOnStart(build)
image, flavor, block_devices, nova_args = yield self.renderWorkerPropsOnStart(build)
res = yield threads.deferToThread(self._start_instance, image, flavor,
block_devices)
block_devices, nova_args)
return res

def _start_instance(self, image_uuid, flavor_uuid, block_devices):
def _start_instance(self, image_uuid, flavor_uuid, block_devices, nova_args):
boot_args = [self.workername, image_uuid, flavor_uuid]
boot_kwargs = dict(
meta=self.meta,
block_device_mapping_v2=block_devices,
**self.nova_args)
**nova_args)
instance = self.novaclient.servers.create(*boot_args, **boot_kwargs)
# There is an issue when using sessions that the status is not
# available on the first try. Trying again will work fine. Fetch the
Expand Down

0 comments on commit bebb5f9

Please sign in to comment.