summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUkesh Kumar Vasudevan <ukeshkumar@gmail.com>2016-08-19 18:10:19 +0530
committerMatt Riedemann <mriedem@us.ibm.com>2016-08-20 08:38:35 -0400
commit01de5a9f68ad474e9bfa213ffeb3501066a52ebd (patch)
tree486aa9f0c663444abbc57dad51ca201735da6866
parent65c1fbae702fe10db22c70e148381389d64f1f67 (diff)
downloadpython-novaclient-01de5a9f68ad474e9bfa213ffeb3501066a52ebd.tar.gz
Pick first image if can't find the specific image
In pick_image method to just pick the first image it finds if it can't find the specific cirros-*uec image. Also look for the -disk.img since devstack is changing the default image in: Id65ebae73b28da7185cb349b714b659af51ef77f Change-Id: I0e4c38a9e0ae25a922f6b0e09f3f2531f49c88c9 Closes-Bug: 1614118
-rw-r--r--novaclient/tests/functional/base.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/novaclient/tests/functional/base.py b/novaclient/tests/functional/base.py
index 494d8aab..78761bd1 100644
--- a/novaclient/tests/functional/base.py
+++ b/novaclient/tests/functional/base.py
@@ -61,8 +61,16 @@ def pick_flavor(flavors):
def pick_image(images):
for image in images:
- if image.name.startswith('cirros') and image.name.endswith('-uec'):
+ if image.name.startswith('cirros') and (
+ image.name.endswith('-uec') or
+ image.name.endswith('-disk.img')):
return image
+
+ # We didn't find the specific cirros image we'd like to use, so just use
+ # the first available.
+ if images:
+ return images[0]
+
raise NoImageException()