functional tests fail if cirros image not exist

The functional tests are looking for a cirros-*uec image and
if that isn't found they fail:

In the function novaclient/tests/functional/base.py:pick_image,
images variable is a generator object which doesn't have
'__getitem__' attribute and so the functional test is failing.

Change-Id: I32b05ff6f2c7501eff04fa9f180eecf3099389ab
Closes-Bug: 1615594
This commit is contained in:
Ukesh Kumar Vasudevan
2016-08-22 17:13:00 +05:30
parent e71b5369e9
commit 3b834f25c1

View File

@@ -60,7 +60,9 @@ def pick_flavor(flavors):
def pick_image(images):
firstImage = None
for image in images:
firstImage = firstImage or image
if image.name.startswith('cirros') and (
image.name.endswith('-uec') or
image.name.endswith('-disk.img')):
@@ -68,8 +70,8 @@ def pick_image(images):
# We didn't find the specific cirros image we'd like to use, so just use
# the first available.
if images:
return images[0]
if firstImage:
return firstImage
raise NoImageException()