diff options
author | Ukesh Kumar Vasudevan <ukeshkumar@gmail.com> | 2016-08-22 17:13:00 +0530 |
---|---|---|
committer | Ukesh Kumar Vasudevan <ukeshkumar@gmail.com> | 2016-08-22 17:13:00 +0530 |
commit | 3b834f25c1d31ef482116344f97b0a1059d9a836 (patch) | |
tree | 66a94f528fb825cb5f9f8a4fbdb795139a767ad5 /novaclient/tests/functional/base.py | |
parent | e71b5369e926fd5f7c6ffa9e31318e724f93f619 (diff) | |
download | python-novaclient-3b834f25c1d31ef482116344f97b0a1059d9a836.tar.gz |
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
Diffstat (limited to 'novaclient/tests/functional/base.py')
-rw-r--r-- | novaclient/tests/functional/base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/novaclient/tests/functional/base.py b/novaclient/tests/functional/base.py index 1bd2e809..febe1669 100644 --- a/novaclient/tests/functional/base.py +++ b/novaclient/tests/functional/base.py @@ -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() |