@@ -207,7 +207,7 @@
Loading
207 207
        if source_type == 'image':
208 208
            # The size returned for an image is in bytes. Round up to the next
209 209
            # integer GiB.
210 -
            image = nova.images.get(source_uuid)
210 +
            image = nova.glance.get(source_uuid)
211 211
            if hasattr(image, 'OS-EXT-IMG-SIZE:size'):
212 212
                size = getattr(image, 'OS-EXT-IMG-SIZE:size')
213 213
                size_gb = int(math.ceil(size / 1024.0**3))
@@ -227,18 +227,29 @@
Loading
227 227
228 228
    @defer.inlineCallbacks
229 229
    def _getImage(self, build):
230 -
        # If image is a callable, then pass it the list of images. The
231 -
        # function should return the image's UUID to use.
232 -
        image = self.image
233 -
        if callable(image):
234 -
            image_uuid = image(self.novaclient.images.list())
235 -
        else:
236 -
            image_uuid = yield build.render(image)
230 +
        image_uuid = yield build.render(self.image)
231 +
        # check if we got name instead of uuid
232 +
        for image in self.novaclient.glance.list():
233 +
            if image.name == image_uuid:
234 +
                image_uuid = image.id
237 235
        return image_uuid
238 236
237 +
    @defer.inlineCallbacks
238 +
    def _getFlavor(self, build):
239 +
        flavor_uuid = yield build.render(self.flavor)
240 +
        # check if we got name instead of uuid
241 +
        for flavor in self.novaclient.flavors.list():
242 +
            if flavor.name == flavor_uuid:
243 +
                flavor_uuid = flavor.id
244 +
        return flavor_uuid
245 +
239 246
    @defer.inlineCallbacks
240 247
    def renderWorkerProps(self, build):
241 248
        image = yield self._getImage(build)
249 +
        flavor = yield self._getFlavor(build)
250 +
        nova_args = yield build.render(self.nova_args)
251 +
        meta = yield build.render(self.meta)
252 +
242 253
        if self.block_devices is not None:
243 254
            block_devices = []
244 255
            for bd in self.block_devices:
@@ -246,24 +257,24 @@
Loading
246 257
                block_devices.append(rendered_block_device)
247 258
        else:
248 259
            block_devices = None
249 -
        return (image, block_devices)
260 +
        return (image, flavor, block_devices, nova_args, meta)
250 261
251 262
    @defer.inlineCallbacks
252 263
    def start_instance(self, build):
253 264
        if self.instance is not None:
254 265
            raise ValueError('instance active')
255 266
256 -
        image, block_devices = yield self.renderWorkerPropsOnStart(build)
257 -
        res = yield threads.deferToThread(self._start_instance, image,
258 -
                                          block_devices)
267 +
        image, flavor, block_devices, nova_args, meta = yield self.renderWorkerPropsOnStart(build)
268 +
        res = yield threads.deferToThread(self._start_instance, image, flavor,
269 +
                                          block_devices, nova_args, meta)
259 270
        return res
260 271
261 -
    def _start_instance(self, image_uuid, block_devices):
262 -
        boot_args = [self.workername, image_uuid, self.flavor]
272 +
    def _start_instance(self, image_uuid, flavor_uuid, block_devices, nova_args, meta):
273 +
        boot_args = [self.workername, image_uuid, flavor_uuid]
263 274
        boot_kwargs = dict(
264 -
            meta=self.meta,
275 +
            meta=meta,
265 276
            block_device_mapping_v2=block_devices,
266 -
            **self.nova_args)
277 +
            **nova_args)
267 278
        instance = self.novaclient.servers.create(*boot_args, **boot_kwargs)
268 279
        # There is an issue when using sessions that the status is not
269 280
        # available on the first try. Trying again will work fine. Fetch the
Files Coverage
master/buildbot 90.28%
worker/buildbot_worker 85.09%
Project Totals (352 files) 89.98%
Untitled
13541.2
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
13541.1
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
13541.3
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading