summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-08-21 22:07:20 +0000
committerGerrit Code Review <review@openstack.org>2016-08-21 22:07:20 +0000
commit95bf36c0c043b7602256eca1936a87a498a69cd6 (patch)
tree163ad4a0134b8e7168ad54e6faf34fa56bccdb1f
parent84d86d3f3cfd8e64967c624b022685e53b7e75f3 (diff)
parent01de5a9f68ad474e9bfa213ffeb3501066a52ebd (diff)
downloadpython-novaclient-95bf36c0c043b7602256eca1936a87a498a69cd6.tar.gz
Merge "Pick first image if can't find the specific image"
-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 0b219035..263f7912 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()